From a2ced29f7408c246f36367bc4ed05def73acc3c6 Mon Sep 17 00:00:00 2001 From: dayebishouji <1441423987@qq.com> Date: Sat, 17 Oct 2026 16:51:51 +0800 Subject: [PATCH] perf(businesssource): skip unused managed inventory pass --- .aoci/baseline.json | 16 ++++++++-------- aoci.code.txt | 2 +- internal/businesssource/manifest.go | 12 ++++++++---- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.aoci/baseline.json b/.aoci/baseline.json index 28ce5255..061493b4 100644 --- a/.aoci/baseline.json +++ b/.aoci/baseline.json @@ -1,7 +1,7 @@ { "version": 1, "created_at": "2026-08-07T17:44:36Z", - "updated_at": "2026-10-14T19:35:29Z", + "updated_at": "2026-10-17T08:47:34Z", "files": { ".gitattributes": { "role": "index", @@ -137,9 +137,9 @@ }, "aoci.code.txt": { "role": "index", - "sha256": "21fc0c3b60157f4d7f815c5e884b49f91c3b032115ce2ca5452e33e7c156355f", - "size": 208106, - "normalized_sha256": "21fc0c3b60157f4d7f815c5e884b49f91c3b032115ce2ca5452e33e7c156355f" + "sha256": "570f0b958f19e9a980d8574123e11d09aba2d997a88a86ef49b9aabd56946625", + "size": 208114, + "normalized_sha256": "570f0b958f19e9a980d8574123e11d09aba2d997a88a86ef49b9aabd56946625" }, "aoci.meta.txt": { "role": "index", @@ -563,10 +563,10 @@ }, "internal/businesssource/manifest.go": { "role": "index", - "sha256": "d55e30895ca801c036fb646e62da549227af4936231102f6bcd1bf2ca1d2c393", - "size": 9045, - "normalized_sha256": "d55e30895ca801c036fb646e62da549227af4936231102f6bcd1bf2ca1d2c393", - "format_sha256": "d55e30895ca801c036fb646e62da549227af4936231102f6bcd1bf2ca1d2c393", + "sha256": "52381fae17ef5b480b422914d8dcb7c570ae6f315f51d34078b277029f8f25f5", + "size": 9120, + "normalized_sha256": "52381fae17ef5b480b422914d8dcb7c570ae6f315f51d34078b277029f8f25f5", + "format_sha256": "52381fae17ef5b480b422914d8dcb7c570ae6f315f51d34078b277029f8f25f5", "format_kind": "gofmt" }, "internal/businesssource/manifest_test.go": { diff --git a/aoci.code.txt b/aoci.code.txt index 15d1df71..44636793 100644 --- a/aoci.code.txt +++ b/aoci.code.txt @@ -69,7 +69,7 @@ hash.go[CG7M]: F:Computes raw, CRLF-normalized, and gofmt-derived identities for scope_detect.go[CG7S]: F:Separates Index-role governance drift from Observe-only fingerprint drift against the active Managed Scope Baseline | R:code:internal/baseline/baseline.go,code:internal/index/types.go | A:DetectManagedScope | S:Callers must first prove desired and active policy identities match; direct policy edits are Scope Change, never permission to reinterpret Baseline roles ===/home/alkor2000/aoci-code-public-staging-phase1/public-candidate/internal/businesssource/=== -manifest.go[CG8M]: F:Builds deterministic public-source manifests without reading excluded secrets or runtime data | R:code:internal/fs/git_command.go | A:ErrScopeChangeRequired | S:Managed manifests include Index and Observe, exclude formal cognition and Exclude paths, and omit GeneratedAt from aggregate identity; a scope-change refusal is a sentinel so a caller can recognise that cause without matching text and avoid reporting it a second time +manifest.go[CG8M]: F:Builds deterministic public-source manifests without reading excluded secrets or runtime data | R:code:internal/fs/git_command.go | A:ErrScopeChangeRequired | S:Managed manifests use managed-state Index/Observe and fingerprints, excluding formal cognition and Exclude paths; standalone Safe Inventory is Legacy-only; GeneratedAt is omitted from aggregate identity; scope-change refusal is a sentinel so callers avoid a duplicate finding ===/home/alkor2000/aoci-code-public-staging-phase1/public-candidate/internal/capability/=== manifest.go[CG8S]: F:Builds the machine capability manifest for CLI, MCP, layouts, schemas, interactions, and PostgreSQL, MySQL, and openGauss Evidence | R:code:internal/machinecontract/capabilities.go,code:internal/cognition/loader.go | A:capability-manifest/v1 | S:openGauss Schema Evidence is an additive capability; the exact nine-tool MCP name identity and input schemas remain unchanged diff --git a/internal/businesssource/manifest.go b/internal/businesssource/manifest.go index 2c8e4059..39f693da 100644 --- a/internal/businesssource/manifest.go +++ b/internal/businesssource/manifest.go @@ -74,16 +74,20 @@ func Build(repositoryRoot, generatedAt string) (*Manifest, error) { if err != nil { return nil, fmt.Errorf("business_source_configuration_invalid") } - inventory, err := afs.BuildSafeInventory(root, cfg.WalkOptions()) - if err != nil { - return nil, fmt.Errorf("business_source_inventory_invalid: %w", err) + managed := cfg.ManagedScope != nil || cfg.CognitionBudget != nil + var inventory *afs.SafeInventory + if !managed { + inventory, err = afs.BuildSafeInventory(root, cfg.WalkOptions()) + if err != nil { + return nil, fmt.Errorf("business_source_inventory_invalid: %w", err) + } } curationDocument, _, curationSHA, err := curation.Load(root) if err != nil { return nil, fmt.Errorf("business_source_curation_invalid") } formal := map[string]bool{"aoci.txt": true, "aoci.meta.txt": true, "aoci.code.txt": true, "aoci.database.txt": true} - if cfg.ManagedScope != nil || cfg.CognitionBudget != nil { + if managed { state, stateErr := managedstate.Load(root, cfg) if stateErr != nil { return nil, fmt.Errorf("business_source_managed_scope_invalid: %w", stateErr)