@veewo/gitnexus 1.5.0-rc.4 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/benchmark/agent-context/runner.js +3 -0
- package/dist/benchmark/agent-context/runner.test.js +22 -0
- package/dist/benchmark/agent-context/tool-runner.d.ts +7 -6
- package/dist/benchmark/agent-safe-query-context/io.d.ts +2 -0
- package/dist/benchmark/agent-safe-query-context/io.js +86 -0
- package/dist/benchmark/agent-safe-query-context/io.test.d.ts +1 -0
- package/dist/benchmark/agent-safe-query-context/io.test.js +13 -0
- package/dist/benchmark/agent-safe-query-context/report.d.ts +57 -0
- package/dist/benchmark/agent-safe-query-context/report.js +159 -0
- package/dist/benchmark/agent-safe-query-context/report.test.d.ts +1 -0
- package/dist/benchmark/agent-safe-query-context/report.test.js +362 -0
- package/dist/benchmark/agent-safe-query-context/runner.d.ts +44 -0
- package/dist/benchmark/agent-safe-query-context/runner.js +406 -0
- package/dist/benchmark/agent-safe-query-context/runner.test.d.ts +1 -0
- package/dist/benchmark/agent-safe-query-context/runner.test.js +290 -0
- package/dist/benchmark/agent-safe-query-context/semantic-tuple.d.ts +20 -0
- package/dist/benchmark/agent-safe-query-context/semantic-tuple.js +225 -0
- package/dist/benchmark/agent-safe-query-context/semantic-tuple.test.d.ts +1 -0
- package/dist/benchmark/agent-safe-query-context/semantic-tuple.test.js +122 -0
- package/dist/benchmark/agent-safe-query-context/subagent-live.d.ts +47 -0
- package/dist/benchmark/agent-safe-query-context/subagent-live.js +128 -0
- package/dist/benchmark/agent-safe-query-context/subagent-live.test.d.ts +1 -0
- package/dist/benchmark/agent-safe-query-context/subagent-live.test.js +155 -0
- package/dist/benchmark/agent-safe-query-context/telemetry-tool.d.ts +9 -0
- package/dist/benchmark/agent-safe-query-context/telemetry-tool.js +77 -0
- package/dist/benchmark/agent-safe-query-context/types.d.ts +61 -0
- package/dist/benchmark/agent-safe-query-context/types.js +8 -0
- package/dist/benchmark/analyze-runner.d.ts +1 -1
- package/dist/benchmark/analyze-runner.js +4 -3
- package/dist/benchmark/analyze-runner.test.js +7 -0
- package/dist/benchmark/runtime-poc/provenance-artifact.d.ts +47 -0
- package/dist/benchmark/runtime-poc/provenance-artifact.js +89 -0
- package/dist/benchmark/runtime-poc/runner.d.ts +31 -0
- package/dist/benchmark/runtime-poc/runner.js +163 -0
- package/dist/benchmark/u2-e2e/hydration-policy-repeatability-runner.d.ts +8 -0
- package/dist/benchmark/u2-e2e/hydration-policy-repeatability-runner.js +21 -0
- package/dist/benchmark/u2-e2e/phase2-runtime-claim-acceptance-runner.d.ts +0 -1
- package/dist/benchmark/u2-e2e/phase2-runtime-claim-acceptance-runner.js +53 -51
- package/dist/benchmark/u2-e2e/phase2-runtime-claim-acceptance-runner.test.js +0 -1
- package/dist/benchmark/u2-e2e/phase5-rule-lab-acceptance-runner.d.ts +1 -1
- package/dist/benchmark/u2-e2e/phase5-rule-lab-acceptance-runner.js +82 -18
- package/dist/benchmark/u2-e2e/phase5-rule-lab-acceptance-runner.test.js +1 -2
- package/dist/benchmark/u2-e2e/retrieval-runner.js +15 -7
- package/dist/benchmark/u2-e2e/retrieval-runner.test.js +46 -0
- package/dist/cli/ai-context.d.ts +0 -1
- package/dist/cli/ai-context.js +5 -6
- package/dist/cli/ai-context.test.js +8 -0
- package/dist/cli/analyze-options.js +58 -34
- package/dist/cli/analyze-options.test.js +57 -0
- package/dist/cli/analyze-runtime-summary.js +2 -0
- package/dist/cli/analyze-runtime-summary.test.js +12 -0
- package/dist/cli/analyze-summary.d.ts +4 -0
- package/dist/cli/analyze-summary.js +43 -0
- package/dist/cli/analyze-summary.test.js +65 -1
- package/dist/cli/analyze.d.ts +11 -0
- package/dist/cli/analyze.js +34 -5
- package/dist/cli/analyze.test.d.ts +1 -0
- package/dist/cli/analyze.test.js +25 -0
- package/dist/cli/benchmark-agent-context.js +1 -1
- package/dist/cli/benchmark-agent-safe-query-context.d.ts +20 -0
- package/dist/cli/benchmark-agent-safe-query-context.js +39 -0
- package/dist/cli/benchmark-agent-safe-query-context.test.d.ts +1 -0
- package/dist/cli/benchmark-agent-safe-query-context.test.js +271 -0
- package/dist/cli/benchmark-unity.js +1 -1
- package/dist/cli/benchmark-unity.test.js +5 -1
- package/dist/cli/benchmark.d.ts +29 -0
- package/dist/cli/benchmark.js +55 -0
- package/dist/cli/index.js +27 -2
- package/dist/cli/rule-lab.d.ts +3 -7
- package/dist/cli/rule-lab.js +13 -22
- package/dist/cli/rule-lab.test.js +23 -3
- package/dist/cli/scope-manifest-config.d.ts +9 -0
- package/dist/cli/scope-manifest-config.js +37 -0
- package/dist/cli/setup.js +40 -41
- package/dist/cli/setup.test.js +14 -14
- package/dist/cli/sync-manifest.d.ts +27 -0
- package/dist/cli/sync-manifest.js +200 -0
- package/dist/cli/sync-manifest.test.d.ts +1 -0
- package/dist/cli/sync-manifest.test.js +88 -0
- package/dist/cli/tool.d.ts +2 -0
- package/dist/cli/tool.js +2 -0
- package/dist/core/config/unity-config.d.ts +1 -1
- package/dist/core/config/unity-config.js +1 -1
- package/dist/core/ingestion/call-processor.d.ts +2 -1
- package/dist/core/ingestion/call-processor.js +28 -6
- package/dist/core/ingestion/heritage-processor.d.ts +2 -1
- package/dist/core/ingestion/heritage-processor.js +30 -7
- package/dist/core/ingestion/import-processor.d.ts +2 -1
- package/dist/core/ingestion/import-processor.js +28 -6
- package/dist/core/ingestion/parsing-processor.d.ts +5 -3
- package/dist/core/ingestion/parsing-processor.js +46 -13
- package/dist/core/ingestion/pipeline.js +100 -19
- package/dist/core/ingestion/unity-lifecycle-synthetic-calls.test.js +18 -20
- package/dist/core/ingestion/unity-parity-seed.d.ts +2 -1
- package/dist/core/ingestion/unity-parity-seed.js +8 -0
- package/dist/core/ingestion/unity-resource-processor.d.ts +11 -0
- package/dist/core/ingestion/unity-resource-processor.js +102 -0
- package/dist/core/ingestion/unity-resource-processor.test.js +449 -0
- package/dist/core/ingestion/unity-runtime-binding-rules.d.ts +16 -1
- package/dist/core/ingestion/unity-runtime-binding-rules.js +193 -42
- package/dist/core/ingestion/workers/parse-worker.d.ts +2 -0
- package/dist/core/ingestion/workers/parse-worker.js +50 -6
- package/dist/core/lbug/csv-generator.test.js +2 -2
- package/dist/core/tree-sitter/csharp-define-profile.d.ts +6 -0
- package/dist/core/tree-sitter/csharp-define-profile.js +43 -0
- package/dist/core/tree-sitter/csharp-preproc-normalizer.d.ts +14 -0
- package/dist/core/tree-sitter/csharp-preproc-normalizer.js +261 -0
- package/dist/core/tree-sitter/parser-loader.d.ts +10 -0
- package/dist/core/tree-sitter/parser-loader.js +19 -0
- package/dist/core/unity/doc-contract.test.d.ts +1 -0
- package/dist/core/unity/doc-contract.test.js +30 -0
- package/dist/core/unity/prefab-source-scan.d.ts +25 -0
- package/dist/core/unity/prefab-source-scan.js +152 -0
- package/dist/core/unity/prefab-source-scan.test.d.ts +1 -0
- package/dist/core/unity/prefab-source-scan.test.js +70 -0
- package/dist/core/unity/scan-context.d.ts +12 -0
- package/dist/core/unity/scan-context.js +50 -2
- package/dist/core/unity/scan-context.test.js +74 -0
- package/dist/mcp/local/agent-safe-response.d.ts +10 -0
- package/dist/mcp/local/agent-safe-response.js +639 -0
- package/dist/mcp/local/derived-process-reader.js +1 -1
- package/dist/mcp/local/local-backend.d.ts +18 -1
- package/dist/mcp/local/local-backend.js +319 -125
- package/dist/mcp/local/process-confidence.d.ts +1 -2
- package/dist/mcp/local/process-confidence.js +0 -3
- package/dist/mcp/local/process-confidence.test.js +4 -2
- package/dist/mcp/local/process-evidence.d.ts +1 -8
- package/dist/mcp/local/process-evidence.js +1 -23
- package/dist/mcp/local/process-evidence.test.js +2 -16
- package/dist/mcp/local/process-ref.d.ts +1 -1
- package/dist/mcp/local/runtime-chain-closure-evaluator.d.ts +33 -0
- package/dist/mcp/local/runtime-chain-closure-evaluator.js +273 -0
- package/dist/mcp/local/runtime-chain-graph-candidates.d.ts +23 -0
- package/dist/mcp/local/runtime-chain-graph-candidates.js +131 -0
- package/dist/mcp/local/runtime-chain-verify.d.ts +1 -1
- package/dist/mcp/local/runtime-chain-verify.js +149 -138
- package/dist/mcp/local/runtime-chain-verify.test.js +126 -68
- package/dist/mcp/local/runtime-claim-rule-registry.d.ts +4 -0
- package/dist/mcp/local/runtime-claim-rule-registry.js +4 -0
- package/dist/mcp/local/runtime-claim-rule-registry.test.js +37 -4
- package/dist/mcp/local/runtime-claim.d.ts +11 -0
- package/dist/mcp/local/runtime-claim.js +28 -0
- package/dist/mcp/local/unity-evidence-view.d.ts +1 -1
- package/dist/mcp/local/unity-evidence-view.js +1 -1
- package/dist/mcp/local/unity-evidence-view.test.js +22 -0
- package/dist/mcp/tools.js +51 -21
- package/dist/rule-lab/analyze.d.ts +2 -1
- package/dist/rule-lab/analyze.js +94 -59
- package/dist/rule-lab/analyze.test.js +238 -20
- package/dist/rule-lab/curate.d.ts +2 -1
- package/dist/rule-lab/curate.js +24 -3
- package/dist/rule-lab/curate.test.js +65 -0
- package/dist/rule-lab/curation-input-builder.d.ts +45 -0
- package/dist/rule-lab/curation-input-builder.js +133 -0
- package/dist/rule-lab/promote.js +80 -7
- package/dist/rule-lab/promote.test.js +150 -0
- package/dist/rule-lab/review-pack.d.ts +3 -0
- package/dist/rule-lab/review-pack.js +41 -1
- package/dist/rule-lab/review-pack.test.js +67 -0
- package/dist/rule-lab/types.d.ts +29 -0
- package/dist/types/pipeline.d.ts +16 -0
- package/package.json +14 -13
- package/scripts/check-sync-manifest-traceability.mjs +203 -0
- package/scripts/run-node-tests.mjs +61 -0
- package/scripts/tree-sitter-audit-classify.mjs +172 -0
- package/skills/_shared/unity-rule-authoring-contract.md +64 -0
- package/skills/_shared/unity-runtime-process-contract.md +16 -0
- package/skills/gitnexus-cli.md +44 -4
- package/skills/gitnexus-debugging.md +9 -0
- package/skills/gitnexus-exploring.md +66 -18
- package/skills/gitnexus-guide.md +42 -3
- package/skills/gitnexus-impact-analysis.md +8 -0
- package/skills/gitnexus-pr-review.md +8 -0
- package/skills/gitnexus-refactoring.md +8 -0
- package/skills/gitnexus-unity-rule-gen.md +66 -312
|
@@ -16,30 +16,45 @@ description: "Use when the user asks how code works, wants to understand archite
|
|
|
16
16
|
## Workflow
|
|
17
17
|
|
|
18
18
|
```
|
|
19
|
-
1. READ gitnexus://repos
|
|
20
|
-
2. READ gitnexus://repo/{name}/context
|
|
21
|
-
3. gitnexus_query({query: "<what you want to understand>"})
|
|
22
|
-
4.
|
|
23
|
-
5. (
|
|
24
|
-
6.
|
|
19
|
+
1. (Repo unknown / multi-repo only) READ gitnexus://repos → Discover indexed repos
|
|
20
|
+
2. READ gitnexus://repo/{name}/context → Codebase overview, check staleness
|
|
21
|
+
3. gitnexus_query({query: "<what you want to understand>"}) → Find related execution flows
|
|
22
|
+
4. Narrow with slim hints first → `decision.recommended_follow_up`, `missing_proof_targets`, `suggested_context_targets`
|
|
23
|
+
5. gitnexus_context({name|uid: "<symbol>"}) → Deep dive on specific symbol
|
|
24
|
+
6. (Unity symbols) rerun context/query with unity params when needed
|
|
25
|
+
7. READ gitnexus://repo/{name}/process/{name} or use cypher → Trace full execution flow or prove a structure
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
Runtime retrieval mnemonic: `discovery -> seed narrowing -> closure verification`.
|
|
29
|
+
|
|
30
|
+
Unity runtime retrieval rule of thumb:
|
|
31
|
+
|
|
32
|
+
- natural-language `query` is discovery-only;
|
|
33
|
+
- do not treat it as the primary retrieval anchor;
|
|
34
|
+
- once you have a symbol or resource seed, switch to `uid` / `resource_path_prefix` narrowing immediately.
|
|
35
|
+
|
|
36
|
+
> If step 2 says "Index is stale" → run `gitnexus analyze` when local CLI exists; otherwise resolve the pinned npx package spec from `~/.gitnexus/config.json` (`cliPackageSpec` first, then `cliVersion`) and run `npx -y <resolved-spec> analyze` (it reuses previous analyze scope/options by default; add `--no-reuse-options` to reset). If the user declines, explicitly warn that retrieval may not reflect the current codebase.
|
|
28
37
|
|
|
29
38
|
## Checklist
|
|
30
39
|
|
|
31
40
|
```
|
|
32
41
|
- [ ] READ gitnexus://repo/{name}/context
|
|
42
|
+
- [ ] Only use `gitnexus://repos` / `list_repos` when the target repo is unknown or multiple repos are indexed
|
|
33
43
|
- [ ] gitnexus_query for the concept you want to understand
|
|
34
|
-
- [ ] Review
|
|
44
|
+
- [ ] Review slim query fields first: `summary`, `candidates`, `process_hints`, `resource_hints`, `resource_chains`, `decision`, `missing_proof_targets`, `suggested_context_targets`, `upgrade_hints`, `runtime_preview`
|
|
45
|
+
- [ ] Prefer narrowing with `decision.recommended_follow_up` and exact `uid`-based context before expanding payload size
|
|
35
46
|
- [ ] gitnexus_context on key symbols for callers/callees
|
|
47
|
+
- [ ] Review slim context fields first: `summary`, `symbol`, `incoming`, `outgoing`, `processes`, `resource_hints`, `resource_chains`, `verification_hint`, `missing_proof_targets`, `suggested_context_targets`, `upgrade_hints`, `runtime_preview`
|
|
48
|
+
- [ ] If you need legacy heavy fields (`processes`, `process_symbols`, `definitions`, `resourceBindings`, `serializedFields`, `next_hops`), rerun with `response_profile: "full"`
|
|
36
49
|
- [ ] For Unity evidence, call context/query with `unity_resources: "on"` and `unity_hydration_mode: "compact"`
|
|
37
|
-
- [ ] If `hydrationMeta.needsParityRetry
|
|
50
|
+
- [ ] If you need `hydrationMeta.needsParityRetry` or strict fallback diagnostics, rerun with `response_profile: "full"` first
|
|
51
|
+
- [ ] If `hydrationMeta.needsParityRetry === true` or `hydrationMeta.fallbackToCompact === true`, rerun with `unity_hydration_mode: "parity"` before closure claims
|
|
38
52
|
- [ ] READ process resource for full execution traces
|
|
53
|
+
- [ ] Use `cypher` when you need a graph-level proof instead of another exploratory hint
|
|
39
54
|
- [ ] Read source files for implementation details
|
|
40
55
|
```
|
|
41
56
|
|
|
42
|
-
## Unity Runtime Process
|
|
57
|
+
## Unity Runtime Process Contract
|
|
43
58
|
|
|
44
59
|
When exploration touches Unity runtime process semantics (runtime chain closure, lifecycle/loader stitching, confidence-based closure), load and follow:
|
|
45
60
|
|
|
@@ -60,30 +75,50 @@ When exploration touches Unity runtime process semantics (runtime chain closure,
|
|
|
60
75
|
|
|
61
76
|
```
|
|
62
77
|
gitnexus_query({query: "payment processing"})
|
|
63
|
-
→
|
|
64
|
-
→
|
|
78
|
+
→ Slim response: summary + candidates + process_hints + resource_hints + resource_chains + decision + missing_proof_targets + suggested_context_targets + upgrade_hints + runtime_preview
|
|
79
|
+
→ Use `decision.recommended_follow_up` first; if `suggested_context_targets[]` includes `uid`, prefer the matching `context --uid` upgrade hint
|
|
80
|
+
→ Rerun with response_profile: "full" only if you need grouped process rows (`processes`, `process_symbols`, `definitions`, `next_hops`) or full `runtime_claim`
|
|
65
81
|
```
|
|
66
82
|
|
|
67
83
|
**gitnexus_context** — 360-degree view of a symbol:
|
|
68
84
|
|
|
69
85
|
```
|
|
70
86
|
gitnexus_context({name: "validateUser"})
|
|
71
|
-
→
|
|
72
|
-
→
|
|
73
|
-
→
|
|
87
|
+
→ Slim response: symbol + incoming/outgoing refs + processes + resource_hints + resource_chains + verification_hint + missing_proof_targets + suggested_context_targets + upgrade_hints + runtime_preview
|
|
88
|
+
→ Use structured `suggested_context_targets[]` and `uid` disambiguation before rerunning full
|
|
89
|
+
→ Rerun with response_profile: "full" for Unity hydration diagnostics, `next_hops`, `runtime_claim`, or larger categorized ref payloads
|
|
74
90
|
```
|
|
75
91
|
|
|
76
|
-
**Unity-focused context/query** — use compact first, parity only when needed:
|
|
92
|
+
**Unity-focused context/query** — use compact first, inspect slim hints, then parity/full only when needed:
|
|
77
93
|
|
|
78
94
|
```
|
|
79
|
-
|
|
80
|
-
|
|
95
|
+
gitnexus_query({
|
|
96
|
+
query: "ReloadBase",
|
|
97
|
+
resource_path_prefix: "Assets/NEON/Graphs/PlayerGun/Gungraph_use/1_weapon_orb_key.asset",
|
|
81
98
|
unity_resources: "on",
|
|
82
99
|
unity_hydration_mode: "compact"
|
|
83
100
|
})
|
|
101
|
+
→ Use symbol/resource anchors for Unity runtime retrieval; do not rely on broad natural-language phrasing
|
|
102
|
+
→ Slim output gives resource/process narrowing hints first
|
|
103
|
+
→ If you need hydration diagnostics, rerun with response_profile: "full"
|
|
84
104
|
→ hydrationMeta.needsParityRetry ? rerun with unity_hydration_mode: "parity" : continue
|
|
85
105
|
```
|
|
86
106
|
|
|
107
|
+
Unity runtime example:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
1. READ gitnexus://repo/neonspark-core/context
|
|
111
|
+
2. gitnexus_query({
|
|
112
|
+
query: "ReloadBase",
|
|
113
|
+
resource_path_prefix: "Assets/NEON/Graphs/PlayerGun/Gungraph_use/1_weapon_orb_key.asset",
|
|
114
|
+
unity_resources: "on",
|
|
115
|
+
unity_hydration_mode: "compact"
|
|
116
|
+
})
|
|
117
|
+
3. Follow `decision.recommended_follow_up` immediately
|
|
118
|
+
4. gitnexus_context({uid: "<exact uid>", unity_resources: "on", runtime_chain_verify: "on-demand"})
|
|
119
|
+
5. READ process resource or use cypher if you need graph proof
|
|
120
|
+
```
|
|
121
|
+
|
|
87
122
|
## Example: "How does payment processing work?"
|
|
88
123
|
|
|
89
124
|
```
|
|
@@ -96,3 +131,16 @@ gitnexus_context({
|
|
|
96
131
|
→ Outgoing: validateCard, chargeStripe, saveTransaction
|
|
97
132
|
4. Read src/payments/processor.ts for implementation details
|
|
98
133
|
```
|
|
134
|
+
|
|
135
|
+
## Runtime-Chain Closure Guard
|
|
136
|
+
|
|
137
|
+
- Query-time runtime closure is **graph-only** and does not require `verification_rules` / `trigger_tokens` matching.
|
|
138
|
+
- For Unity runtime retrieval, prefer symbol/resource anchors over business-description phrasing; use natural-language `query` only to discover the first anchor.
|
|
139
|
+
- `response_profile=slim` is sufficient for normal workflows; use `runtime_preview` as the default status summary.
|
|
140
|
+
- `response_profile=full` is for debugging and deep evidence inspection (`runtime_claim.hops`, `runtime_claim.gaps`, hydration diagnostics).
|
|
141
|
+
- Strong graph hops can coexist with failed closure when verifier-core still reports `failed`; this is partial bridge evidence, not contradiction.
|
|
142
|
+
- Treat runtime-chain outputs as two layers:
|
|
143
|
+
- `verifier-core`: binary verifier result (`verified_full` | `failed`)
|
|
144
|
+
- `policy-adjusted`: user-visible result after hydration policy is applied
|
|
145
|
+
- If `hydration_policy=strict` and `hydrationMeta.fallbackToCompact=true`, the result is downgraded policy-adjusted output and is not closure.
|
|
146
|
+
- In that downgraded state, rerun with parity before final conclusions.
|
package/skills/gitnexus-guide.md
CHANGED
|
@@ -44,6 +44,19 @@ For any task involving code understanding, debugging, impact analysis, or refact
|
|
|
44
44
|
|
|
45
45
|
### Unity Retrieval Contract (query/context)
|
|
46
46
|
|
|
47
|
+
Default `query/context` responses are now slim for agent use:
|
|
48
|
+
|
|
49
|
+
- `query`: `summary`, `candidates`, `process_hints`, `resource_hints`, `resource_chains`, `decision`, `missing_proof_targets`, `suggested_context_targets`, `upgrade_hints`, `runtime_preview`
|
|
50
|
+
- `context`: `summary`, `symbol`, `incoming`, `outgoing`, `processes`, `resource_hints`, `resource_chains`, `verification_hint`, `missing_proof_targets`, `suggested_context_targets`, `upgrade_hints`, `runtime_preview`
|
|
51
|
+
- `suggested_context_targets[]` now returns structured objects: `{ name, uid?, filePath?, why }`
|
|
52
|
+
- `upgrade_hints[]` may include exact `gitnexus context --uid <uid>` commands for same-name disambiguation
|
|
53
|
+
- `resource_chains[]` returns graph-backed Unity seed chains such as `sourceResourcePath -> intermediateResourcePath -> targetSymbol` when a resource seed can be bridged through `UNITY_ASSET_GUID_REF -> UNITY_GRAPH_NODE_SCRIPT_REF`.
|
|
54
|
+
|
|
55
|
+
When you need the legacy heavy payloads (`processes`, `process_symbols`, `definitions`, `resourceBindings`, `serializedFields`, `next_hops`), pass:
|
|
56
|
+
|
|
57
|
+
- `response_profile: "full"` in MCP calls
|
|
58
|
+
- `--response-profile full` in CLI calls
|
|
59
|
+
|
|
47
60
|
When you need Unity resource evidence, pass:
|
|
48
61
|
|
|
49
62
|
- `unity_resources: "on"` (or `"auto"` when you want adaptive behavior)
|
|
@@ -51,11 +64,29 @@ When you need Unity resource evidence, pass:
|
|
|
51
64
|
|
|
52
65
|
Recommended default workflow:
|
|
53
66
|
|
|
54
|
-
1.
|
|
55
|
-
2.
|
|
67
|
+
1. Follow `discovery -> seed narrowing -> closure verification`.
|
|
68
|
+
2. Call `context/query` with `unity_hydration_mode: "compact"` for speed.
|
|
69
|
+
3. Inspect `hydrationMeta` in the response:
|
|
56
70
|
- `needsParityRetry: true` → rerun same call with `unity_hydration_mode: "parity"`
|
|
57
71
|
- `isComplete: true` → keep compact result
|
|
58
|
-
|
|
72
|
+
4. Treat parity as the completeness path for advanced verification.
|
|
73
|
+
|
|
74
|
+
Agent-safe upgrade path:
|
|
75
|
+
|
|
76
|
+
- inspect `resource_chains[]` first for graph-backed Unity resource bridges, then `resource_hints[]` / `process_hints[]` and narrow with `resource_path_prefix=` or symbol-targeted context
|
|
77
|
+
- use `decision.recommended_follow_up` as the default narrow-first next step
|
|
78
|
+
- inspect `missing_proof_targets[]` and structured `suggested_context_targets[]` before considering payload expansion
|
|
79
|
+
- when `suggested_context_targets[]` includes `uid`, prefer the matching `upgrade_hints[]` `context --uid` command over same-name `context(name=...)`
|
|
80
|
+
- `response_profile=slim` is the default and sufficient for normal workflows
|
|
81
|
+
- use `response_profile: "full"` only for debugging/deep evidence inspection when narrowing cannot close the proof gap
|
|
82
|
+
|
|
83
|
+
Runtime claim closure reminder:
|
|
84
|
+
|
|
85
|
+
- Query-time runtime closure is **graph-only** and does not require `verification_rules` / `trigger_tokens` matching.
|
|
86
|
+
- `verification_rules` remains an offline governance/report artifact family.
|
|
87
|
+
- Strong graph hops can coexist with failed closure when verifier-core stays `failed`; report as partial bridge evidence.
|
|
88
|
+
- `gitnexus-unity-rule-gen` public flow is `approved -> compile -> analyze -> CLI validation`; this does not change query-time graph-only closure semantics.
|
|
89
|
+
- If `hydration_policy=strict` and `hydrationMeta.fallbackToCompact=true`, rerun parity before closure claims.
|
|
59
90
|
|
|
60
91
|
When task scope includes Unity runtime process semantics, load and follow:
|
|
61
92
|
|
|
@@ -106,3 +137,11 @@ Lightweight reads (~100-500 tokens) for navigation:
|
|
|
106
137
|
MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "myFunc"})
|
|
107
138
|
RETURN caller.name, caller.filePath
|
|
108
139
|
```
|
|
140
|
+
|
|
141
|
+
## Runtime-Chain Closure Guard
|
|
142
|
+
|
|
143
|
+
- Treat runtime-chain outputs as two layers:
|
|
144
|
+
- `verifier-core`: binary verifier result (`verified_full` | `failed`)
|
|
145
|
+
- `policy-adjusted`: user-visible result after hydration policy is applied
|
|
146
|
+
- If `hydration_policy=strict` and `hydrationMeta.fallbackToCompact=true`, the result is downgraded policy-adjusted output and is not closure.
|
|
147
|
+
- In that downgraded state, rerun with parity before final conclusions.
|
|
@@ -103,3 +103,11 @@ gitnexus_detect_changes({scope: "staged"})
|
|
|
103
103
|
|
|
104
104
|
3. Risk: 2 direct callers, 2 processes = MEDIUM
|
|
105
105
|
```
|
|
106
|
+
|
|
107
|
+
## Runtime-Chain Closure Guard
|
|
108
|
+
|
|
109
|
+
- Treat runtime-chain outputs as two layers:
|
|
110
|
+
- `verifier-core`: binary verifier result (`verified_full` | `failed`)
|
|
111
|
+
- `policy-adjusted`: user-visible result after hydration policy is applied
|
|
112
|
+
- If `hydration_policy=strict` and `hydrationMeta.fallbackToCompact=true`, the result is downgraded policy-adjusted output and is not closure.
|
|
113
|
+
- In that downgraded state, rerun with parity before final conclusions.
|
|
@@ -166,3 +166,11 @@ Structure your review as:
|
|
|
166
166
|
### Recommendation
|
|
167
167
|
APPROVE / REQUEST CHANGES / NEEDS DISCUSSION
|
|
168
168
|
```
|
|
169
|
+
|
|
170
|
+
## Runtime-Chain Closure Guard
|
|
171
|
+
|
|
172
|
+
- Treat runtime-chain outputs as two layers:
|
|
173
|
+
- `verifier-core`: binary verifier result (`verified_full` | `failed`)
|
|
174
|
+
- `policy-adjusted`: user-visible result after hydration policy is applied
|
|
175
|
+
- If `hydration_policy=strict` and `hydrationMeta.fallbackToCompact=true`, the result is downgraded policy-adjusted output and is not closure.
|
|
176
|
+
- In that downgraded state, rerun with parity before final conclusions.
|
|
@@ -127,3 +127,11 @@ RETURN caller.name, caller.filePath ORDER BY caller.filePath
|
|
|
127
127
|
→ Affected: LoginFlow, TokenRefresh
|
|
128
128
|
→ Risk: MEDIUM — run tests for these flows
|
|
129
129
|
```
|
|
130
|
+
|
|
131
|
+
## Runtime-Chain Closure Guard
|
|
132
|
+
|
|
133
|
+
- Treat runtime-chain outputs as two layers:
|
|
134
|
+
- `verifier-core`: binary verifier result (`verified_full` | `failed`)
|
|
135
|
+
- `policy-adjusted`: user-visible result after hydration policy is applied
|
|
136
|
+
- If `hydration_policy=strict` and `hydrationMeta.fallbackToCompact=true`, the result is downgraded policy-adjusted output and is not closure.
|
|
137
|
+
- In that downgraded state, rerun with parity before final conclusions.
|
|
@@ -1,353 +1,107 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gitnexus-unity-rule-gen
|
|
3
|
-
description: "
|
|
3
|
+
description: "Reduced rule-lab workflow for Unity analyze_rules authoring from exact source/target gaps. Use when: 'create unity rules', 'generate analyze rules', 'fill sparse runtime gap'."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Unity
|
|
6
|
+
# Unity Reduced Rule-Lab Authoring
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
This skill is the post-rollback workflow.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Primary path:
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
4. 确认 UNITY_ASSET_GUID_REF 和 UNITY_COMPONENT_INSTANCE 边存在:
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
mcp__gitnexus__cypher:
|
|
21
|
-
query: |
|
|
22
|
-
MATCH ()-[r:CodeRelation]->()
|
|
23
|
-
WHERE r.type IN ['UNITY_ASSET_GUID_REF', 'UNITY_COMPONENT_INSTANCE']
|
|
24
|
-
RETURN r.type AS edgeType, count(*) AS cnt
|
|
25
|
-
repo: <repo-name>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
如果这两种边不存在,说明索引时未启用 Unity 资源解析,需要重新 analyze,**必须加 Unity 参数**:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
gitnexus analyze --force --extensions ".cs .meta"
|
|
32
|
-
# 如果所有代码都在 Assets/ 下,可加 --scope-prefix Assets/ 缩短分析时间
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## Phase 1: 规则录入循环
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
loop:
|
|
41
|
-
1.1 收集用户链路线索
|
|
42
|
-
1.2 图谱探索补全
|
|
43
|
-
1.3 多路径确认
|
|
44
|
-
1.4 binding 类型判定
|
|
45
|
-
1.5 生成规则 YAML 并暂存
|
|
46
|
-
1.6 询问用户:是否继续录入下一条规则?
|
|
47
|
-
- 是 → 回到 1.1
|
|
48
|
-
- 否 → 进入 Phase 2
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### 1.1 收集用户链路线索
|
|
52
|
-
|
|
53
|
-
向用户询问:
|
|
54
|
-
|
|
55
|
-
| 信息 | 问题 | 示例 |
|
|
56
|
-
|------|------|------|
|
|
57
|
-
| 场景名称 | 你想验证哪个资源→代码链路? | weapon-powerup-gungraph |
|
|
58
|
-
| 资源引用字段 | 哪些序列化字段名触发资源加载? | `gungraph\|graph` |
|
|
59
|
-
| 目标入口方法 | 加载的资源上哪些方法会被触发? | OnEnable, Awake |
|
|
60
|
-
| 持有字段的类 | 哪些类持有触发加载的字段? | WeaponPowerUp |
|
|
61
|
-
| 加载方法 | 哪些方法触发资源加载? | Equip |
|
|
62
|
-
| 动态跳转 | 链路中是否有事件派发或回调(C# Action/SyncList/delegate)? | `NetEventHub.OnPickUpItem → OnClientPickItUp` |
|
|
63
|
-
| 额外 lifecycle | 项目有自定义入口方法吗? | Init |
|
|
64
|
-
| lifecycle 范围 | 自定义入口方法的作用范围? | Assets/Code/Graph |
|
|
65
|
-
|
|
66
|
-
### 1.2 图谱探索补全
|
|
67
|
-
|
|
68
|
-
用户不确定某些字段时,按优先级探索:**Cypher 直查 > gitnexus context > 文件 grep**
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
# 查找资源引用字段名
|
|
72
|
-
mcp__gitnexus__cypher:
|
|
73
|
-
query: |
|
|
74
|
-
MATCH ()-[r:CodeRelation {type:'UNITY_ASSET_GUID_REF'}]->()
|
|
75
|
-
RETURN DISTINCT r.reason
|
|
76
|
-
LIMIT 20
|
|
77
|
-
repo: <repo-name>
|
|
78
|
-
|
|
79
|
-
# 查找挂载在资源上的组件类
|
|
80
|
-
mcp__gitnexus__cypher:
|
|
81
|
-
query: |
|
|
82
|
-
MATCH (c:Class)-[r:CodeRelation {type:'UNITY_COMPONENT_INSTANCE'}]->(f:File)
|
|
83
|
-
WHERE f.filePath CONTAINS '.asset'
|
|
84
|
-
RETURN c.name, f.filePath
|
|
85
|
-
LIMIT 20
|
|
86
|
-
repo: <repo-name>
|
|
87
|
-
|
|
88
|
-
# 查找特定类的方法列表
|
|
89
|
-
mcp__gitnexus__context:
|
|
90
|
-
name: <ClassName>
|
|
91
|
-
repo: <repo-name>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
如果图谱查询无结果,回退到文件直读:
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
# 查找 [SerializeField] 字段
|
|
98
|
-
Grep: pattern="\[SerializeField\]" path=<Assets目录>
|
|
99
|
-
|
|
100
|
-
# 查找特定方法定义
|
|
101
|
-
Grep: pattern="void Init\b|void Setup\b" path=<Assets目录>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### 1.3 多路径确认
|
|
105
|
-
|
|
106
|
-
- 同一位置 ≥2 候选路径 → **向用户确认**选择哪条
|
|
107
|
-
- 探索 3 步无结果 → **向用户补充提问**
|
|
108
|
-
|
|
109
|
-
### 1.4 binding 类型判定
|
|
110
|
-
|
|
111
|
-
| 链路特征 | binding kind | 说明 |
|
|
112
|
-
|---------|-------------|------|
|
|
113
|
-
| asset GUID 引用 → 目标资源组件激活 | `asset_ref_loads_components` | 序列化字段引用 asset,加载时触发组件 lifecycle |
|
|
114
|
-
| 方法调用 → 字段引用的资源加载 | `method_triggers_field_load` | 特定方法触发序列化字段引用的资源加载 |
|
|
115
|
-
| 方法调用 → SceneManager.LoadScene → 场景组件激活 | `method_triggers_scene_load` | 特定方法触发场景加载,场景中组件 lifecycle 被触发 |
|
|
116
|
-
| 动态跳转(事件派发/回调/delegate,静态分析不可见) | `method_triggers_method` | 声明"方法 A 动态触发方法 B",注入合成 CALLS 边桥接 gap |
|
|
117
|
-
| 项目自定义入口方法 | `lifecycle_overrides` | 非标准 Unity lifecycle 的自定义入口 |
|
|
118
|
-
|
|
119
|
-
### 1.5 生成规则 YAML
|
|
120
|
-
|
|
121
|
-
使用以下模板,根据收集的线索填充:
|
|
12
|
+
1. Gather user-confirmed exact source/target pair(s).
|
|
13
|
+
2. Curate/promote to `rules/approved/*.yaml`.
|
|
14
|
+
3. Compile approved rules.
|
|
15
|
+
4. Re-run analyze and verify via CLI graph checks (not MCP session query/context).
|
|
122
16
|
|
|
123
|
-
|
|
124
|
-
id: unity.<scenario-name>.v2
|
|
125
|
-
version: 2.0.0
|
|
126
|
-
family: analyze_rules
|
|
127
|
-
description: >-
|
|
128
|
-
(可选)描述该规则覆盖的业务场景和调用链背景,
|
|
129
|
-
包括动态跳转的机制说明(事件派发/回调绑定等)。
|
|
130
|
-
trigger_family: <scenario-name>
|
|
131
|
-
resource_types:
|
|
132
|
-
- asset
|
|
133
|
-
host_base_type:
|
|
134
|
-
- MonoBehaviour
|
|
135
|
-
- ScriptableObject
|
|
17
|
+
`gap-lab` is migration history only and is not part of active operator guidance.
|
|
136
18
|
|
|
137
|
-
|
|
138
|
-
trigger_tokens:
|
|
139
|
-
- <token1>
|
|
140
|
-
- <token2>
|
|
141
|
-
host_base_type:
|
|
142
|
-
- MonoBehaviour
|
|
143
|
-
- ScriptableObject
|
|
144
|
-
resource_types:
|
|
145
|
-
- asset
|
|
19
|
+
Read first:
|
|
146
20
|
|
|
147
|
-
|
|
21
|
+
- `gitnexus/skills/_shared/unity-rule-authoring-contract.md`
|
|
22
|
+
- `docs/unity-runtime-process-source-of-truth.md`
|
|
23
|
+
- `docs/gap-lab-rule-lab-architecture.md`
|
|
148
24
|
|
|
149
|
-
|
|
150
|
-
- kind: asset_ref_loads_components
|
|
151
|
-
ref_field_pattern: "<field_pattern>"
|
|
152
|
-
target_entry_points:
|
|
153
|
-
- OnEnable
|
|
154
|
-
- Awake
|
|
25
|
+
## Hard Boundaries
|
|
155
26
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
loader_methods:
|
|
160
|
-
- <method_name>
|
|
27
|
+
1. Query-time runtime closure remains graph-only.
|
|
28
|
+
2. Event/delegate large-scale gaps are analyzer work, not rule-authoring work.
|
|
29
|
+
3. This skill is for sparse irregular gaps only.
|
|
161
30
|
|
|
162
|
-
|
|
163
|
-
- kind: method_triggers_scene_load
|
|
164
|
-
host_class_pattern: "<class_pattern>"
|
|
165
|
-
loader_methods:
|
|
166
|
-
- <method_name>
|
|
167
|
-
scene_name: "<scene_name>" # 匹配 .unity 文件名(不含扩展名)
|
|
168
|
-
target_entry_points:
|
|
169
|
-
- Awake
|
|
170
|
-
- Start
|
|
171
|
-
- OnEnable
|
|
31
|
+
## Input Contract (required)
|
|
172
32
|
|
|
173
|
-
|
|
174
|
-
# 适用场景:C# Action/UnityEvent 事件派发、Mirror SyncList 回调、delegate 绑定等
|
|
175
|
-
# 注入一条 source_method → target_method 的合成 CALLS 边(精确匹配,一条边)
|
|
176
|
-
- kind: method_triggers_method
|
|
177
|
-
description: >-
|
|
178
|
-
说明动态跳转的机制:例如"A 通过 EventHub.OnXxx?.Invoke() 触发,
|
|
179
|
-
B 在初始化时订阅该事件",或"A 调用 SyncList.Add(),
|
|
180
|
-
触发 SyncList.Callback 回调到 B"
|
|
181
|
-
source_class_pattern: "<source_class_regex>" # 例如 "^PlayerActor$"
|
|
182
|
-
source_method: "<source_method_name>" # 例如 "ProcessInteractables"
|
|
183
|
-
target_class_pattern: "<target_class_regex>" # 例如 "^NetPlayer$"
|
|
184
|
-
target_method: "<target_method_name>" # 例如 "OnClientPickItUp"
|
|
33
|
+
Provide exact pair intent for each candidate:
|
|
185
34
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
scope: "<path_prefix>"
|
|
35
|
+
- source class + source method
|
|
36
|
+
- target class + target method
|
|
37
|
+
- expected missing runtime hop
|
|
190
38
|
|
|
191
|
-
|
|
192
|
-
required_hops:
|
|
193
|
-
- resource
|
|
194
|
-
- guid_map
|
|
195
|
-
- code_loader
|
|
196
|
-
- code_runtime
|
|
39
|
+
If anchors are ambiguous (multiple candidate methods/classes), stop and ask user to choose explicit options. Do not auto-guess.
|
|
197
40
|
|
|
198
|
-
|
|
199
|
-
guarantees:
|
|
200
|
-
- resource_to_runtime_chain_closed
|
|
201
|
-
non_guarantees:
|
|
202
|
-
- no_runtime_execution
|
|
203
|
-
- no_dynamic_data_flow_proof
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### 1.6 暂存并询问
|
|
207
|
-
|
|
208
|
-
将生成的 YAML 暂存(不写入文件),向用户确认:
|
|
41
|
+
## Direct Public Flow
|
|
209
42
|
|
|
210
|
-
|
|
43
|
+
### Phase A: Prepare exact pairs
|
|
211
44
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
## Phase 2: 写入 + compile + analyze
|
|
218
|
-
|
|
219
|
-
### 2.1 写入规则文件
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
mkdir -p "$TARGET_REPO/.gitnexus/rules/approved"
|
|
223
|
-
# 将每条暂存的 YAML 写入对应文件
|
|
224
|
-
# 文件名: approved/<ruleId>.yaml
|
|
225
|
-
```
|
|
45
|
+
1. Confirm repo and index freshness.
|
|
46
|
+
2. Normalize candidate pairs into explicit source/target tuples.
|
|
47
|
+
3. Run duplicate precheck against `.gitnexus/rules/approved/*.yaml`.
|
|
226
48
|
|
|
227
|
-
###
|
|
49
|
+
### Phase B: Review and curate
|
|
228
50
|
|
|
229
51
|
```bash
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
52
|
+
gitnexus rule-lab analyze --repo-path "$REPO_PATH"
|
|
53
|
+
RUN_ID="$(ls -1t "$REPO_PATH/.gitnexus/rules/lab/runs" | head -n 1)"
|
|
54
|
+
SLICE_ID="$(find "$REPO_PATH/.gitnexus/rules/lab/runs/$RUN_ID/slices" -name 'slice.json' -maxdepth 2 | head -n 1 | xargs -I{} basename "$(dirname "{}")")"
|
|
55
|
+
gitnexus rule-lab review-pack --repo-path "$REPO_PATH" --run-id "$RUN_ID" --slice-id "$SLICE_ID"
|
|
56
|
+
gitnexus rule-lab curate --repo-path "$REPO_PATH" --run-id "$RUN_ID" --slice-id "$SLICE_ID" --input-path "$CURATION_JSON_PATH"
|
|
234
57
|
```
|
|
235
58
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
```json
|
|
239
|
-
{
|
|
240
|
-
"id": "<ruleId>",
|
|
241
|
-
"version": "2.0.0",
|
|
242
|
-
"enabled": true,
|
|
243
|
-
"file": "approved/<ruleId>.yaml",
|
|
244
|
-
"family": "analyze_rules"
|
|
245
|
-
}
|
|
246
|
-
```
|
|
59
|
+
Use `analyze` as proposal generation for exact pairs, then curate/promote only proposals that pass guards.
|
|
60
|
+
Do not ask users to provide `run-id`/`slice-id`; resolve them from generated artifacts.
|
|
247
61
|
|
|
248
|
-
###
|
|
62
|
+
### Phase C: Promote approved rule
|
|
249
63
|
|
|
250
64
|
```bash
|
|
251
|
-
gitnexus rule-lab
|
|
65
|
+
gitnexus rule-lab promote --repo-path "$REPO_PATH" --run-id "$RUN_ID" --slice-id "$SLICE_ID"
|
|
252
66
|
```
|
|
253
67
|
|
|
254
|
-
###
|
|
68
|
+
### Phase D: Compile and re-index
|
|
255
69
|
|
|
256
70
|
```bash
|
|
257
|
-
gitnexus
|
|
258
|
-
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
---
|
|
262
|
-
|
|
263
|
-
## Phase 3: 逐一验证
|
|
264
|
-
|
|
265
|
-
对每条规则执行 4 项验证,每项给出 PASS/FAIL 判定。
|
|
266
|
-
|
|
267
|
-
### 验证 1: 合成边存在性
|
|
268
|
-
|
|
269
|
-
```
|
|
270
|
-
mcp__gitnexus__cypher:
|
|
271
|
-
query: |
|
|
272
|
-
MATCH (a)-[r:CodeRelation {type: 'CALLS'}]->(b)
|
|
273
|
-
WHERE r.reason STARTS WITH 'unity-rule-'
|
|
274
|
-
RETURN r.reason AS reason, count(*) AS cnt
|
|
275
|
-
ORDER BY cnt DESC
|
|
276
|
-
repo: <repo-name>
|
|
71
|
+
gitnexus rule-lab compile --repo-path "$REPO_PATH" --family analyze_rules
|
|
72
|
+
gitnexus analyze -f "$REPO_PATH"
|
|
277
73
|
```
|
|
278
74
|
|
|
279
|
-
|
|
280
|
-
**FAIL 诊断**: 规则未被 pipeline 加载 → 检查 catalog.json 的 `family` 字段。
|
|
281
|
-
|
|
282
|
-
### 验证 2: 运行时链路验证
|
|
75
|
+
## Three Mandatory Guards
|
|
283
76
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
77
|
+
1. Duplicate-prevention:
|
|
78
|
+
- Block if pair already covered by `rules/approved/*.yaml`.
|
|
79
|
+
2. Fail-closed binding resolution:
|
|
80
|
+
- Block if unresolved binding remains.
|
|
81
|
+
- `UnknownClass` / `UnknownMethod` placeholders are forbidden.
|
|
82
|
+
3. Non-empty evidence before promote:
|
|
83
|
+
- `confirmed_chain.steps` (or equivalent) must be non-empty.
|
|
290
84
|
|
|
291
|
-
|
|
292
|
-
**FAIL 诊断**:
|
|
293
|
-
- `rule_not_matched` → 规则的 `trigger_tokens` 未匹配查询文本
|
|
294
|
-
- `verification_failed` → 图谱中无匹配的 `unity-rule-*` 合成边
|
|
295
|
-
|
|
296
|
-
### 验证 3: Process 完整性
|
|
297
|
-
|
|
298
|
-
```
|
|
299
|
-
mcp__gitnexus__context:
|
|
300
|
-
name: "<target_class>"
|
|
301
|
-
repo: <repo-name>
|
|
302
|
-
```
|
|
85
|
+
## Verification
|
|
303
86
|
|
|
304
|
-
**
|
|
305
|
-
|
|
87
|
+
1. Verify synthetic edges with **CLI in a fresh process** (for example `gitnexus cypher` / `gitnexus query`).
|
|
88
|
+
2. Do not use current MCP session `query/context` as synthetic-edge acceptance evidence immediately after analyze/rebuild.
|
|
89
|
+
3. Inspect analyze summary `rule_binding.*` diagnostics:
|
|
90
|
+
- `rule_binding.agent_report: should_report=false` → no anomaly to report.
|
|
91
|
+
- `rule_binding.agent_report: should_report=true` → summarize `rule_binding.anomaly:*` in your run report.
|
|
92
|
+
4. Keep closure claims aligned to graph-only semantics.
|
|
93
|
+
5. Under `hydration_policy=strict` with `fallbackToCompact=true`, run parity before final closure conclusion.
|
|
306
94
|
|
|
307
|
-
|
|
95
|
+
Suggested acceptance check (example):
|
|
308
96
|
|
|
97
|
+
```bash
|
|
98
|
+
gitnexus cypher --repo "$REPO_ALIAS" \
|
|
99
|
+
"MATCH (a)-[r:CodeRelation {type:'CALLS'}]->(b)
|
|
100
|
+
WHERE r.reason STARTS WITH 'unity-rule-'
|
|
101
|
+
RETURN a.name, b.name, r.reason
|
|
102
|
+
LIMIT 50"
|
|
309
103
|
```
|
|
310
|
-
mcp__gitnexus__cypher:
|
|
311
|
-
query: |
|
|
312
|
-
MATCH (a)-[r:CodeRelation {type: 'CALLS'}]->(b)
|
|
313
|
-
WHERE r.reason STARTS WITH 'unity-rule-'
|
|
314
|
-
RETURN
|
|
315
|
-
CASE
|
|
316
|
-
WHEN r.reason CONTAINS 'resource-load' THEN 'resource-load'
|
|
317
|
-
WHEN r.reason CONTAINS 'lifecycle-override' THEN 'lifecycle-override'
|
|
318
|
-
WHEN r.reason CONTAINS 'loader-bridge' THEN 'loader-bridge'
|
|
319
|
-
WHEN r.reason CONTAINS 'scene-load' THEN 'scene-load'
|
|
320
|
-
WHEN r.reason CONTAINS 'method-bridge' THEN 'method-bridge'
|
|
321
|
-
ELSE 'other'
|
|
322
|
-
END AS edgeKind,
|
|
323
|
-
count(*) AS cnt
|
|
324
|
-
repo: <repo-name>
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
**PASS**: 规则涉及的边类型均有产出(`method_triggers_method` 对应 `method-bridge`)。
|
|
328
|
-
|
|
329
|
-
---
|
|
330
|
-
|
|
331
|
-
## 失败诊断路径
|
|
332
|
-
|
|
333
|
-
| 症状 | 可能原因 | 修复方向 |
|
|
334
|
-
|------|---------|---------|
|
|
335
|
-
| 验证 1 失败(0 合成边) | 规则未被 compile 或 family 不对 | 检查 catalog.json + compiled bundle |
|
|
336
|
-
| 验证 1 部分(只有 resource-load) | method_triggers_field_load 参数错误 | 检查 host_class_pattern / loader_methods |
|
|
337
|
-
| 验证 1 部分(无 scene-load) | method_triggers_scene_load 参数错误 | 检查 scene_name 是否匹配 .unity 文件名 |
|
|
338
|
-
| 验证 1 部分(无 method-bridge) | method_triggers_method 类名/方法名不匹配 | 检查 source/target_class_pattern 和 source/target_method 是否与图谱中节点名一致 |
|
|
339
|
-
| 验证 2 失败(rule_not_matched) | trigger_tokens 未匹配查询文本 | 调整 match.trigger_tokens |
|
|
340
|
-
| 验证 2 失败(verification_failed) | 合成边 reason 中的 ruleId 不匹配 | 检查规则 ID 一致性 |
|
|
341
|
-
| 验证 3 失败(无 Process) | 合成边 confidence 过低 | 检查 RULE_EDGE_CONFIDENCE(应为 0.75) |
|
|
342
|
-
| 验证 4 链路断裂(中间有动态跳转) | 事件派发/回调/delegate 无静态 CALLS 边 | 添加 `method_triggers_method` binding 桥接动态跳转 |
|
|
343
|
-
| lifecycle_overrides 无效 | scope 值不是文件路径前缀 | scope 应匹配 filePath 而非类名 |
|
|
344
|
-
|
|
345
|
-
---
|
|
346
104
|
|
|
347
|
-
##
|
|
105
|
+
## Legacy Note
|
|
348
106
|
|
|
349
|
-
|
|
350
|
-
- YAML 格式定义:设计文档 section 3.3
|
|
351
|
-
- 注入逻辑:`gitnexus/src/core/ingestion/unity-runtime-binding-rules.ts`
|
|
352
|
-
- 规则类型定义:`gitnexus/src/rule-lab/types.ts:90-114`
|
|
353
|
-
- 编译命令:`gitnexus rule-lab compile --repo-path <path>`
|
|
107
|
+
If historical `.gitnexus/gap-lab/runs/**` artifacts exist, treat them as migration evidence only. Do not require gap-lab parity/coverage gates for direct `approved -> compile -> analyze -> CLI validation` loops.
|