nccgs 2.0.0-rc.3 → 2.1.0

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.
Files changed (76) hide show
  1. package/.claude/nccgs/MEMORY.md +7 -2
  2. package/.claude/nccgs/VERSION +1 -1
  3. package/.claude/nccgs/packages/ponytail/README.md +2 -2
  4. package/.claude/nccgs/protocols/agent-contract.md +15 -2
  5. package/.claude/nccgs/protocols/bounded-repair.md +135 -7
  6. package/.claude/nccgs/protocols/editor-session-evidence.md +52 -0
  7. package/.claude/nccgs/protocols/orchestration.md +7 -5
  8. package/.claude/nccgs/protocols/review-handoff.md +17 -1
  9. package/.claude/nccgs/protocols/standalone-gates.md +64 -8
  10. package/.claude/nccgs/protocols/standalone.md +33 -13
  11. package/.claude/nccgs/protocols/task-gates.md +13 -1
  12. package/.claude/nccgs/protocols/task-slices.md +106 -0
  13. package/.claude/nccgs/routing.generated.md +20 -0
  14. package/.claude/nccgs/tools/command-process.mjs +10 -4
  15. package/.claude/nccgs/tools/compile-policy.mjs +8 -0
  16. package/.claude/nccgs/tools/configure-models.mjs +4 -0
  17. package/.claude/nccgs/tools/editor-session-evidence.mjs +66 -0
  18. package/.claude/nccgs/tools/gates.mjs +7 -4
  19. package/.claude/nccgs/tools/handoff.mjs +51 -0
  20. package/.claude/nccgs/tools/inputs.mjs +36 -1
  21. package/.claude/nccgs/tools/installation-guard.mjs +55 -0
  22. package/.claude/nccgs/tools/lifecycle.mjs +21 -0
  23. package/.claude/nccgs/tools/orchestration.mjs +264 -14
  24. package/.claude/nccgs/tools/repair-packet.mjs +29 -10
  25. package/.claude/nccgs/tools/returned-handoff.mjs +38 -0
  26. package/.claude/nccgs/tools/review-budget.mjs +171 -0
  27. package/.claude/nccgs/tools/review-handoff.mjs +42 -8
  28. package/.claude/nccgs/tools/runtime.mjs +7 -2
  29. package/.claude/nccgs/tools/session-budget.mjs +67 -0
  30. package/.claude/nccgs/tools/task-slices.mjs +147 -0
  31. package/.claude/nccgs/tools/task.mjs +39 -2
  32. package/.claude/nccgs/tools/tool-guard.mjs +19 -5
  33. package/.claude/nccgs/tools/unity-repair.mjs +128 -0
  34. package/.claude/nccgs/tools/verification-jobs.mjs +13 -3
  35. package/.claude/nccgs/tools/windows-compiler-server.cs +163 -0
  36. package/.claude/nccgs/tools/windows-job.cs +8 -1
  37. package/CHANGELOG.md +142 -0
  38. package/MEMORY.md +7 -2
  39. package/README.md +57 -27
  40. package/UPGRADING.md +27 -18
  41. package/VERSION +1 -1
  42. package/docs/ARCHITECTURE.md +45 -18
  43. package/docs/BOUNDED-REPAIR.md +76 -7
  44. package/docs/EDITOR-SESSION-EVIDENCE.md +52 -0
  45. package/docs/HANDOFF-AUTOMATION.md +144 -0
  46. package/docs/HUONG-DAN-MIGRATE-VA-SU-DUNG.md +68 -11
  47. package/docs/PHASE-1-OPERATIONS.md +142 -1
  48. package/docs/PHASE-2-OPERATIONS.md +1 -1
  49. package/docs/RELEASE-STATUS.md +102 -4
  50. package/docs/TASK-SLICING.md +57 -0
  51. package/docs/UNINSTALL.md +134 -0
  52. package/docs/UPGRADE-QUALIFICATION.md +1 -1
  53. package/docs/WORKFLOWS.md +1 -1
  54. package/package.json +2 -2
  55. package/scaffold/.nccgs/templates/repair-unity-code.json +18 -0
  56. package/scaffold/.nccgs/templates/repair-unity-editor.json +21 -0
  57. package/scaffold/.nccgs/templates/task-slices.json +28 -0
  58. package/scripts/cli.mjs +15 -2
  59. package/scripts/install.mjs +14 -0
  60. package/scripts/recover-session.mjs +89 -0
  61. package/scripts/run.mjs +21 -8
  62. package/scripts/supervise.mjs +30 -6
  63. package/scripts/uninstall.mjs +292 -0
  64. package/scripts/validate.mjs +6 -0
  65. package/scripts/work-handoff.mjs +38 -0
  66. package/tests/editor-session-evidence.test.mjs +45 -0
  67. package/tests/fixtures/compiler-shutdown.cs +64 -0
  68. package/tests/orchestration-v15.test.mjs +52 -1
  69. package/tests/phase1.test.mjs +92 -0
  70. package/tests/policy-v15.test.mjs +14 -0
  71. package/tests/review-budget.test.mjs +177 -0
  72. package/tests/runtime-v15.test.mjs +572 -4
  73. package/tests/session-budget.test.mjs +34 -0
  74. package/tests/task-slices.test.mjs +285 -0
  75. package/tests/uninstall.test.mjs +477 -0
  76. package/tests/unity-generated.test.mjs +140 -0
@@ -1,8 +1,10 @@
1
1
  # NCCGS — portable framework decisions
2
2
 
3
3
  NCCGS means **New Claude Code Game Studio** and targets **Claude Code**.
4
- This is the public 2.0.0-rc.3 release candidate, distributed through npm's next tag.
5
- It is not stable promotion. The package README and changelog describe release scope.
4
+ This is the unpublished 2.1.0 source, adding reversible project uninstallation.
5
+ The earlier 2.0.0 release was published on 2026-10-28; its archive is unchanged.
6
+ Local preparation does not change npm tags. Native qualification remains scoped
7
+ to its frozen archives; see README.md and CHANGELOG.md for evidence boundaries.
6
8
  Project-specific authorizations, provider sessions, budgets and internal development
7
9
  history are retained separately, outside the public package. Nothing in this file
8
10
  authorizes spending, provider access or changes to a user's project by itself.
@@ -19,6 +21,9 @@ authorizes spending, provider access or changes to a user's project by itself.
19
21
  remains unknown. Never infer execution from a requested alias or a handoff marker.
20
22
  - Preserve failed attempts, negative reviews, task history, evidence and consumed
21
23
  allowances. An update, migration, retry or new report must not reset spent budgets.
24
+ - Uninstall only from an external terminal after sessions and owned work stop.
25
+ Preserve game source, custom files and .nccgs history/budgets. Uninstall never
26
+ closes tasks, waives review/acceptance or authorizes deleting retained records.
22
27
  - Known-solution or contaminated benchmark baselines remain reference-only; do not
23
28
  score them as independent NCCGS runs.
24
29
 
@@ -1 +1 @@
1
- 2.0.0-rc.3
1
+ 2.1.0
@@ -41,6 +41,6 @@ existing migration-review process. No separate installation is needed.
41
41
 
42
42
  These are agent instructions, not a semantic acceptance gate or a guarantee that
43
43
  a model follows them. Existing NCCGS ownership, budgets, evidence, independent
44
- review and closure gates remain authoritative. This package does not repair the
45
- separate standalone design/readiness workflow gap. Its effect on delivery quality,
44
+ review and closure gates remain authoritative. Standalone design and readiness
45
+ follow the separate design lifecycle protocol. This package's effect on delivery quality,
46
46
  time and token use requires fresh real Claude Code evaluation.
@@ -56,13 +56,19 @@ with evidence and unresolved findings; do not spend more rounds or infer approva
56
56
  General context/time guidance is advisory; task review-round limits are enforced
57
57
  separately. A bounded repair packet additionally enforces its tool-call allowances
58
58
  and deadline at each tool admission. Its chosen solution, exact source files and
59
- handoff are the assignment. No shell, MCP, web, nested delegation or unplanned
60
- experiments are allowed in that repair worker; return PARTIAL if diagnosis is still
59
+ handoff are the assignment. General shell, MCP, web, nested delegation and unplanned
60
+ experiments are blocked. A typed Unity packet may permit only its fixed
61
+ `repair-editor` wrapper; follow [bounded repair](bounded-repair.md). Return PARTIAL if diagnosis is still
61
62
  needed. The coordinator owns verification after the edits. Follow the injected
62
63
  packet and use remaining tool allowances to hand off before native turn exhaustion.
63
64
 
64
65
  ## Required handoff
65
66
 
67
+ For a [planned slice](task-slices.md), follow its injected objective, exact files,
68
+ dependency dispatches and original criterion definitions. Keep global constraints.
69
+ Return a complete bounded handoff or honest PARTIAL; only the coordinator records
70
+ the integrated task. A slice handoff is not acceptance and grants no fresh budget.
71
+
66
72
  When the reservation declares handoffPaths, write a concise draft to the assigned
67
73
  path early, before extended investigation. Start it with `NCCGS-HANDOFF: PARTIAL`.
68
74
  Update it as facts become available. Reserve your final few turns for the handoff;
@@ -76,6 +82,13 @@ says COMPLETE. For every review assignment follow [review handoff](review-handof
76
82
  the reviewer owns the structured verdict and explicit remaining conditions; a
77
83
  conditional PASS is not permitted under the new standalone review policy.
78
84
 
85
+ Use the supplied PARTIAL template when available. Before returning, non-repair
86
+ workers may run the fixed read-only `task handoff-validate` command for their own
87
+ declared handoff. It catches structural errors while the worker can still correct
88
+ its draft; VALID is not completion or acceptance. Run it as a plain
89
+ `node .claude/nccgs/tools/task.mjs` invocation. Repair workers keep their existing
90
+ tool budget and no-shell boundary. See [handoff operations](../../../docs/HANDOFF-AUTOMATION.md).
91
+
79
92
  For unfinished work, leave PARTIAL with exact next steps and return. Continuation
80
93
  uses a fresh foreground reservation and fresh handoff path within the existing
81
94
  remaining dispatch/purpose budget. The coordinator must carry forward the previous
@@ -1,9 +1,12 @@
1
- # Bounded source repair — 2.0 RC
1
+ # Bounded repair — source edits and Unity operations
2
+
3
+ Typed Unity packets below ship in the **prepared, unpublished 2.0.0 stable package**.
4
+ Schema-1 packets and existing reservations retain their original behavior and limits.
2
5
 
3
6
  The Unity phase-2 retest exhausted a repair worker's 22 native turns while exploring
4
7
  parameters in a scratch harness. It made no gameplay change and left a PARTIAL
5
8
  handoff. A protected dispatch slot alone did not reserve time to deliver an edit.
6
- Fresh repair reservations now require a concrete source-edit packet and durable
9
+ Fresh repair reservations require a concrete repair packet and durable
7
10
  tool admission limits. Existing failed cases and legacy reservations stay unchanged.
8
11
 
9
12
  ## Prepare the decision before spending the repair slot
@@ -23,6 +26,8 @@ additional reads loading that package or reopen exploration to optimize diff siz
23
26
  Copy `.nccgs/templates/repair-packet.json` into
24
27
  `.nccgs/evidence/work-packets/UNIQUE.json` and replace every placeholder:
25
28
 
29
+ This is the unchanged schema-1 source-edit format:
30
+
26
31
  - `taskId`, `contractHash`, `sourceSnapshot`: current task and snapshot from the CLI.
27
32
  - `problem`, `solution`: concise failure and already-chosen correction.
28
33
  - `changes`: 1–4 exact existing source files, each with a concrete instruction.
@@ -35,6 +40,117 @@ Copy `.nccgs/templates/repair-packet.json` into
35
40
  including 6 reads/searches, 3 separate handoff writes, and 600000 ms from claim.
36
41
  The packet is at most 16 KiB. Limits cannot be raised in the request.
37
42
 
43
+ ## Select a Unity repair profile when needed
44
+
45
+ Use a **fresh schema-2 packet**, never change an already reserved packet or relabel
46
+ a repair as delivery. The existing negative-feedback requirement and aggregate
47
+ repair/QA/review allowances apply to every profile.
48
+
49
+ | Profile | Exact files | Work calls / reads | Handoff writes | Deadline |
50
+ |---|---:|---:|---:|---:|
51
+ | schema 1, source edit | 1–4 existing | 12 / 6 | 3 | 10 minutes |
52
+ | schema 2, `unity-code` | 1–8 edit/create | 24 / 12 | 3 | 15 minutes |
53
+ | schema 2, `unity-editor` | 1–8 edit/create | 20 / 8 | 3 | 15 minutes |
54
+
55
+ These are ceilings, not targets, extra native turns or extensions to task-wide
56
+ time/cost/dispatch budgets. Packet budget fields may lower them. Schema-2 packets
57
+ are at most 32 KiB. Larger or unresolved work returns PARTIAL for a new bounded
58
+ decision within remaining allowances; no automatic retry or budget reset.
59
+
60
+ Start from `.nccgs/templates/repair-unity-code.json` or
61
+ `.nccgs/templates/repair-unity-editor.json`. Keep the common identity, problem,
62
+ chosen solution, context and full verification list. Add `repairType` and an
63
+ explicit `operation: "edit"` or `"create"` to every change.
64
+
65
+ - `unity-code`: C#, assembly definitions/references, shaders/includes, UXML and USS
66
+ under `Assets/`. Structured file edits are allowed only for these exact files.
67
+ Include a focused regression file when the correction needs one.
68
+ - `unity-editor`: scenes, prefabs, assets, materials, controllers and animations
69
+ under `Assets/`. Apply and save through the pinned Editor operations only;
70
+ Write/Edit/MultiEdit cannot edit these assets or their metadata.
71
+ A coupled correction may also list code files and edit those with structured
72
+ file tools in the same packet, within the shared eight-file/work allowance.
73
+ - Existing targets need valid companion `.meta` GUIDs. New targets and their
74
+ metadata must both be absent at reservation. Parents must already exist.
75
+ New folders, deletion/renaming, packages and ProjectSettings are outside these
76
+ profiles; do not smuggle them into an Editor script or widen writePaths.
77
+ - `writePaths` lists exactly the changed targets, not their metadata or directories.
78
+ The scope guard also tracks each target's Unity-generated companion `.meta`.
79
+ Preserve all existing GUIDs. Never invent or hand-write metadata.
80
+
81
+ Typed Unity repair has exclusive project ownership until it finishes or is
82
+ externally reconciled. A captured source inventory rejects undeclared created,
83
+ changed or deleted files, including unrelated import side effects. This is a
84
+ post-operation guard, not a rollback or an OS sandbox. Keep other project writers
85
+ idle; use a clean Editor state with the exact target scene/prefab selected in the
86
+ operation, never depend on an unspecified active scene.
87
+
88
+ ## Pin Editor steps before dispatch
89
+
90
+ `unity.steps` is an ordered array of up to four entries. Existing-code-only packets
91
+ may use `[]`. New code needs an import step; every `unity-editor` packet needs at
92
+ least one Editor step. Finish import/save and generated metadata **before the
93
+ worker returns**, so the runtime observation covers the same source as verification.
94
+
95
+ The supported adapter is the installed **Unity CLI** and its connected Editor
96
+ commands. Use the bundled [Unity CLI guidance](../../skills/unity-cli/SKILL.md)
97
+ and the specific official Unity skill for the chosen operation during preparation.
98
+ Use existing discovery captured by delivery or operator preflight for this project;
99
+ do not guess commands or install/upgrade tooling inside repair. When steps are
100
+ present, pin that discovery as `unity.capabilities: {path, sha256}` under evidence.
101
+ Discovery context is not provider or acceptance evidence. MCP names from another
102
+ integration are not interchangeable with this adapter.
103
+
104
+ Each step contains `id`, a discovered `command`, positional `arguments` and
105
+ `timeoutMs` from 1000 to 60000. No argument may begin with `-`: project routing,
106
+ timeouts and global flags are supplied by the runner. New 2.0.0 reservations require
107
+ the discovered **eval** command with one C# statement body using fully qualified
108
+ types for exact named assets; top-level using directives are rejected.
109
+ The pinned **loaded-scenes-clean-v1** policy prepends a check in that same Editor
110
+ eval, before the packet body. Any loaded dirty scene (including untitled and
111
+ non-active additive scenes) returns a correlated refusal. No auto-save, discard
112
+ or scene switch occurs. The receipt records the blocked scene as a failed step;
113
+ the worker returns PARTIAL, retains the attempt and lets the owner resolve work.
114
+ A new eligible packet consumes normal quota; a blocked step never replays itself.
115
+ Legacy reservations retain their original pinned invocation without retroactive
116
+ guard injection. The guard checks entry state; review the entire body, including
117
+ any later scene switches, and save only explicitly owned changes.
118
+ Review the body during packet preparation; pinning code does not make arbitrary
119
+ C# safe. The worker cannot change it or substitute another command.
120
+
121
+ The injected prompt supplies foreground Bash inputs of this shape:
122
+
123
+ ```json
124
+ {
125
+ "command": "node .claude/nccgs/tools/task.mjs repair-editor --id TASK --dispatch DISPATCH_ID --step STEP_ID",
126
+ "timeout": 35000
127
+ }
128
+ ```
129
+
130
+ The tool timeout must be at least the step timeout plus 5000 ms, at most 120000 ms.
131
+ Use one plain invocation. The runner requires the correlated worker's prior tool
132
+ admission, launches `unity command` without a shell, fixes `--project-path` to the
133
+ current project's real path and uses finite timeouts. It does not open an Editor,
134
+ install a package, create a detached service or grant native permissions.
135
+
136
+ A step gets a durable started record before execution and one original receipt
137
+ under `.nccgs/evidence/repair-operations/`. Repeating its ID never executes it again.
138
+ `EXECUTED` means the CLI returned zero and the source scope check passed; inspect
139
+ its actual output. It is **not** a compile/test result or acceptance PASS. Long
140
+ compile/EditMode/PlayMode/build checks stay with the coordinator's managed jobs.
141
+
142
+ An interrupted, timed-out or nonzero Editor call may still have effects in the
143
+ resident Editor. Its dispatch stays UNCERTAIN and keeps ownership. Write the
144
+ remaining PARTIAL handoff, preserve the receipt and stop. An external operator must
145
+ confirm the operation stopped and reconcile the original attempt before another
146
+ writer can start. Missing CLI executables are recorded as failed without claiming
147
+ Editor execution. No path rolls back user files or refunds calls/attempts.
148
+ If the native worker returns first, its runtime observation, usage and partial
149
+ handoff are retained while the repair stays UNCERTAIN. Duplicate completion events
150
+ reuse that observation; they neither double-count usage nor release ownership.
151
+
152
+ ## Reserve the chosen packet
153
+
38
154
  The reservation must contain the packet path, exactly matching writePaths, and one
39
155
  fresh handoff path. It still needs recorded negative feedback and eligible remaining
40
156
  repair capacity within the original aggregate budget:
@@ -66,11 +182,10 @@ Direct writes to pinned packet/context evidence are refused even after completio
66
182
 
67
183
  ## Execute and hand off
68
184
 
69
- The worker may Read/Grep/Glob inside the project and Write/Edit/MultiEdit the exact
70
- source files. The assigned handoff is the only evidence file it can edit. Shells,
71
- MCP, web tools, nested agents and other tools are refused for this repair protocol.
72
- Editor/asset operations requiring Unity tools need a different properly scoped
73
- assignment; do not relabel repair as delivery to evade these limits.
185
+ The worker may Read/Grep/Glob inside the project and use only the selected profile's
186
+ edits or fixed Editor steps. The assigned handoff is the only evidence file it can
187
+ edit. General shell commands, MCP, web and nested agents are refused. Schema 1 has
188
+ no shell exception; schema 2 permits only its fixed `repair-editor` wrapper.
74
189
 
75
190
  Write `NCCGS-HANDOFF: PARTIAL` early. Apply the chosen correction, then replace that
76
191
  line with `NCCGS-HANDOFF: COMPLETE` only when the assigned edits are finished.
@@ -98,6 +213,9 @@ The coordinator then runs declared checks with `task verify`, collects their ori
98
213
  receipts, records the work stage and dispatches protected QA and independent review
99
214
  when eligible. Failing measurements still block PASS and DONE. No helper exit code
100
215
  or handoff marker substitutes for measured acceptance.
216
+ New implementation records preserve prior negative review and task history. A fresh
217
+ independent reviewer still owns its exact verdict and conditions. External/manual
218
+ acceptance gates remain separate; Editor receipts cannot satisfy measured criteria.
101
219
 
102
220
  ## Validation and rollout boundary
103
221
 
@@ -112,7 +230,17 @@ the original cap. They establish framework behavior, not actual Claude performan
112
230
  Unity gameplay viability, provider usage or token savings. A new real Claude/Unity
113
231
  acceptance run is still required. NCCGS is a workflow guard, not an OS sandbox or
114
232
  protection against malicious code, falsified measurements or externally edited ledgers.
233
+ Typed Unity tests use synthetic source/metadata and an injected fake Editor process,
234
+ plus an actual missing-executable CLI failure. They do not launch Unity or Claude.
235
+ Profile capacities, CLI compatibility and delivery efficiency still need a fresh
236
+ authorized native evaluation; historical game cases remain frozen.
115
237
 
116
238
  Native hook output uses `PreToolUse.hookSpecificOutput.updatedInput` for the packet
117
239
  and `additionalContext` for remaining counts, without granting native permissions.
118
240
  See the [official Claude Code hooks reference](https://code.claude.com/docs/en/hooks#pretooluse-decision-control).
241
+
242
+ ## External Editor stop handoff
243
+
244
+ Publish the original operator start/shutdown/stop receipts into reviewer-readable
245
+ project evidence before handing off. Preserve sealed cases through a separate
246
+ addendum; never recreate or overwrite historical process facts. See the installed `editor-session-evidence.mjs` helper and `editor-session-evidence.md` protocol.
@@ -0,0 +1,52 @@
1
+ # Editor lifecycle evidence visible to the reviewer
2
+
3
+ An external operator may own a Unity Editor while native workers run bounded
4
+ operations. Keep ownership with that operator. Before handing the task to review,
5
+ publish the operator's existing start, graceful shutdown command and settled stop
6
+ receipts under the project's `.nccgs/evidence/editor-control/` directory.
7
+ An external artifact directory alone is insufficient when the reviewer can only
8
+ read the project tree.
9
+
10
+ Use the installed helper from the external operator's existing harness:
11
+
12
+ ```js
13
+ import { publishEditorSessionEvidence } from './.claude/nccgs/tools/editor-session-evidence.mjs';
14
+ const reference = publishEditorSessionEvidence(project, {
15
+ sourceProject: project,
16
+ startFile: absoluteStartReceipt,
17
+ stopFile: absoluteStopReceipt,
18
+ shutdownFile: absoluteShutdownCommandReceipt
19
+ });
20
+ ```
21
+
22
+ The supported receipt format is the Windows owned-Editor harness format: start
23
+ has `at`, `project`, and `identity` (`pid`, `windowsJob`, `groupName`); stop has the
24
+ same identity, `state: "dead"`, `forced: false`, and `result: {code: 0, signal: null}`.
25
+ The shutdown command receipt has `at`, fixed Unity `args` with the exact
26
+ `--project-path` and `UnityEditor.EditorApplication.Exit(0)`, its own owned CLI
27
+ identity, `treeState: "dead"`, `code: 0`, and `signal: null`.
28
+
29
+ The helper checks ownership/project consistency, event order and reported normal
30
+ settlement. It copies the three original files byte for byte, adds SHA-256
31
+ references, and returns the reference to an immutable receipt bundle. Existing
32
+ bundle IDs cannot be overwritten. Include that reference in the coordinator's
33
+ review handoff alongside the ordinary managed-check receipts.
34
+
35
+ This publisher performs no process operation or live process probe. The operator
36
+ must still verify its owned group is dead using the existing process manager.
37
+ Forced, failed, live or uncertain stops retain their original evidence and cannot
38
+ be published as a normal stop by this helper. A copied receipt is not a new stop,
39
+ native worker execution, a reviewer verdict, or acceptance evidence for gameplay.
40
+ Untrusted receipt contents never authorize commands. Other producer formats need
41
+ an explicit adapter and qualification; do not invent observations to fit this one.
42
+
43
+ When the original case is already sealed, publish to a separate addendum project
44
+ and pass the original absolute `sourceProject`. The bundle marks itself as a
45
+ historical import. Keep the original task, findings, costs and hashes untouched;
46
+ a fresh independent reviewer assesses the addendum without rewriting the old
47
+ verdict. Do not restart the Editor merely to manufacture a replacement receipt.
48
+
49
+ For future runs, publish after every externally controlled normal stop, including
50
+ the stop after resolving an unsaved-scene refusal, before the next native handoff.
51
+ This evidence step does not grant save/discard authority, expand worker scope,
52
+ waive any check, or enlarge the original total budget.
@@ -6,7 +6,8 @@ Use this protocol when work benefits from more than one studio role.
6
6
  2. Separate decision work, implementation work, and independent verification.
7
7
  3. Assign one accountable owner to every output and writable path.
8
8
  4. Express dependencies as a directed acyclic graph.
9
- 5. Run independent read-only analysis in parallel; serialize overlapping writes.
9
+ 5. Schedule independent work by dependency and ownership. In standalone 2.0.0,
10
+ launch foreground calls sequentially and collect each final result before the next.
10
11
  6. Stop dependent work when an upstream contract is unresolved.
11
12
 
12
13
  Default maximum subagent depth is one. The primary session composes the graph,
@@ -40,7 +41,7 @@ work cannot bypass this sequence. See [the handoff protocol](astra-claude.md).
40
41
  Use `nccgs-task-scout` only to close a named factual gap. Do not launch a scout,
41
42
  design consultation, or extra reviewer when existing evidence already answers the
42
43
  question. Each reviewer must cover a distinct risk. Preserve one accountable
43
- implementer even when independent support work runs in parallel.
44
+ implementer even when support spans multiple specialists.
44
45
 
45
46
  Keep only one reviewer in flight per task. Standalone checks work-stage readiness
46
47
  before reserving review and again before launch. A rejected launch is automatically
@@ -58,9 +59,10 @@ explicit external extension, never automatic approval.
58
59
 
59
60
  Native agent `maxTurns` comes from the installed role frontmatter; a larger
60
61
  `Agent.max_turns` request is not evidence that the role cap increased. Templates
61
- are authoritative and policy compilation synchronizes the registry. Designer,
62
- gameplay/Unity implementation and review roles have bounded allowances of 48,
63
- 120 and 64 turns respectively; lighter scout/FAST roles keep their short budgets.
62
+ are authoritative and policy compilation synchronizes the registry. Read the
63
+ [generated turn-ceiling table](../routing.generated.md) rather than copying limits
64
+ into assignments. Check installed frontmatter and session overrides before launch;
65
+ these ceilings neither extend task budgets nor establish observed execution.
64
66
 
65
67
  An external operator can reallocate a pinned dispatch limit with `task
66
68
  extend-dispatch --id TASK --request FILE`. The request must contain
@@ -1,5 +1,11 @@
1
1
  # Reviewer-owned verdict and remaining conditions
2
2
 
3
+ For a reservation with `handoffTransport: "native-result"`, return the entire
4
+ Markdown handoff as one final text block and do not write a file. The native hook
5
+ copies it verbatim into the single declared fresh handoff path. The exact same
6
+ review contract, independent identity and gates below still apply. Other
7
+ reservations retain the existing file-writing workflow.
8
+
3
9
  New standalone installs enable `reviewContractRequired: true`. The completed
4
10
  review dispatch must pin the same Markdown handoff used as the review stage's
5
11
  `evidence`. The reviewer writes exactly one `nccgs-review` fenced JSON block:
@@ -28,6 +34,16 @@ Prose explains the evidence, scope and limits; the block is the authoritative
28
34
  verdict, assessment, findings and remaining conditions. Coordinator stage input
29
35
  must copy these four fields exactly, including an explicit `conditions` array.
30
36
 
37
+ Use `task dispatch-prompt --id TASK --dispatch ID` to prepare the registered
38
+ assignment and a PARTIAL draft. Before returning, the running reviewer can call
39
+ the fixed `task handoff-validate --id TASK --dispatch ID --file PATH` operation
40
+ for its own declared handoff. Correct structural errors in that draft while the
41
+ invocation is still active. VALID checks structure only; it never approves work.
42
+ After native completion, the coordinator uses `task record-review --id TASK
43
+ --dispatch ID --file PATH` to copy the pinned result through the existing review
44
+ gate without retyping its fields. Run each as one plain invocation of
45
+ `node .claude/nccgs/tools/task.mjs`. See [handoff operations](../../../docs/HANDOFF-AUTOMATION.md).
46
+
31
47
  PASS requires `conditions: []`. If acceptance still depends on a diff, test,
32
48
  source read or other check, return BLOCKED or CHANGES_REQUIRED with that condition.
33
49
  A finished negative review may mark its handoff COMPLETE. Do not write a conditional
@@ -44,7 +60,7 @@ remaining allowance cannot fund the required follow-up.
44
60
 
45
61
  For a broad delivery review, check the effective native role `maxTurns` before
46
62
  dispatch. A number in the assignment prompt does not override the role's limit.
47
- The shipped reviewer allows up to 200 turns; this is a ceiling, not a target.
63
+ Read the [generated native ceilings](../routing.generated.md); a ceiling is not a target.
48
64
  Keep session cost, time and dispatch limits active. Index current receipts, raw
49
65
  files and source changes before review, and use focused reads instead of repeatedly
50
66
  loading whole histories. Write a truthful PARTIAL handoff early and update it as
@@ -1,8 +1,10 @@
1
- # NCCGS 2.0 RC — implementation and operation
1
+ # NCCGS 2.0.0 — implementation and operation
2
2
 
3
- Version: **2.0.0-rc.3**. Target executor: **Claude Code**.
4
- Framework tests and scoped native delivery evidence exist. Fresh end-to-end
5
- qualification of this exact RC and published-1.3 upgrade qualification are pending. Read [MEMORY.md](../MEMORY.md) before interpreting evaluation results.
3
+ Version: **2.0.0**. Target executor: **Claude Code**.
4
+ Framework tests and scoped native delivery evidence exist. A new full Unity task
5
+ through this exact stable archive is not claimed. Published-1.3 upgrade qualification
6
+ passed within its documented fixture scope; see [release status](../../../docs/RELEASE-STATUS.md).
7
+ Read [MEMORY.md](../MEMORY.md) before interpreting evaluation results.
6
8
 
7
9
  ## Policies and migration
8
10
 
@@ -35,6 +37,20 @@ the packaged UPGRADING.md for failure recovery and legacy task handling.
35
37
 
36
38
  ## Intake, classification and modes
37
39
 
40
+ Before initializing a fresh Unity task, map its known generated IDE/local metadata
41
+ as exact `unityGeneratedFiles` paths in `.nccgs/inputs.json` (see
42
+ [input freshness](task-gates.md#input-freshness-and-bounded-verification)). Preserve
43
+ other input mappings and timeout ceilings. Inspect existing IDE files: custom or
44
+ build-input files stay tracked. No automatic directory/glob ignore is applied.
45
+ The manifest is pinned at init; generated-file hashes remain in verification
46
+ receipts, while source, assets, packages and ProjectSettings remain in the source
47
+ snapshot. Existing tasks retain their original inputs and historical verdicts.
48
+
49
+ Large implementation tasks may use `task slice-preview|slice-plan --id TASK --file
50
+ PLAN` and `task slice-status --id TASK`; see [task slices](task-slices.md).
51
+ These commands preserve the original task and gates. A pinned plan tracks bounded
52
+ delivery assignments, not replacement contracts or additional budgets.
53
+
38
54
  Example `.nccgs/evidence/intake/hud-fix.json`:
39
55
 
40
56
  ```json
@@ -123,7 +139,7 @@ Use the returned ID in the Agent prompt prefix `[NCCGS-DISPATCH:ID]`, select the
123
139
  specified role and task route, and include contract, inputs, ownership and acceptance.
124
140
  PreToolUse claims the slot with actual session/tool-use identity. SubagentStart binds
125
141
  an unambiguous agent ID. Foreground PostToolUse completion captures final telemetry.
126
- For this preview use foreground calls; background runs hold slots until correlated
142
+ Use foreground calls; background runs hold slots until correlated
127
143
  final evidence or external reconciliation. SubagentStop alone cannot prove model,
128
144
  effort or complete usage. Ambiguous same-role starts are not guessed.
129
145
 
@@ -146,6 +162,9 @@ Audit/plan protect one review slot. Existing ledgers retain their pinned allocat
146
162
  At most two implementation workers can reserve disjoint paths; review/analysis
147
163
  cannot overlap source writers. Direct edit tools enforce ownership. Opaque shell/MCP
148
164
  operations are not OS-sandboxed by NCCGS; inspect their actual diff and test effects.
165
+ Typed Unity repair requires exclusive project ownership, exact pinned Editor steps
166
+ and a source-scope audit. An uncertain Editor operation retains that ownership
167
+ even after the native worker returns; its observed usage and handoff remain recorded.
149
168
  Audit/plan/review block arbitrary shells and unknown tools. Use read tools, declared
150
169
  analysis artifacts and externally supplied command evidence when required.
151
170
 
@@ -189,6 +208,11 @@ With reviewContractRequired, the completed reviewer's pinned handoff must contai
189
208
  exactly one nccgs-review JSON block; copy its verdict, criteriaMet, findings and
190
209
  conditions exactly into the stage payload. Pending conditions block PASS. Follow
191
210
  [review handoff](review-handoff.md); a coordinator cannot remove those conditions.
211
+ For source versions with handoff automation, the coordinator can instead use
212
+ `task record-review --id TASK --dispatch ID --file PATH` to import those fields
213
+ directly from the completed pinned handoff through the same record gate. The
214
+ running worker can first use `task handoff-validate` on its own declared file to
215
+ catch structure errors. See [handoff operations](../../../docs/HANDOFF-AUTOMATION.md).
192
216
  For design revisions, run fixed `task design-compare --id TASK --baseline PINNED_SOURCE
193
217
  --file DECLARED_CANDIDATE` before the final review and supply its immutable receipt.
194
218
 
@@ -258,7 +282,38 @@ Telemetry reports known subtotals and coverage for duration, tool calls, tokens
258
282
  cost. Total is null if any started attempt lacks that metric. Observed zero remains
259
283
  zero. These are worker measurements; coordinator work, human delay and billing are
260
284
  not automatically covered. A configured spend/time ceiling cannot interrupt an
261
- already running provider request and refuses new dispatch with unknown measurements.
285
+ already running provider request. Unknown duration still blocks its optional cap.
286
+
287
+ When worker cost is missing, `limits.maxCostUsd` can instead use a conservative
288
+ supervised-session ceiling. `nccgs run --session-budget-usd` supplies the current
289
+ whole-session allowance, including coordinator work. The guard adds verified
290
+ terminal costs of every prior supervised session in the task ancestry and requires
291
+ that total plus the current allowance fit the original cap. Every started worker
292
+ must belong to those sessions; unknown/corrupt prior usage, expired deadlines,
293
+ uncovered sessions or missing exclusive supervisor ownership block admission.
294
+ Concurrent supervised sessions cannot reuse one project's remaining allowance.
295
+ Each reservation records its budget basis and must launch in that same session.
296
+ This does not backfill worker telemetry: preserve null cost, never allocate the
297
+ session total to a worker or infer it from tokens. Without supervised coverage,
298
+ the optional cost cap still requires complete worker measurements. Pinned limits
299
+ cannot be unset through another reservation. `dispatch-reconcile` only settles
300
+ active/uncertain slots; it does not backfill cost on a completed dispatch.
301
+
302
+ For tasks with a pinned `budget-plan`, the root's protected final-review reserve
303
+ also applies to every child. Work phases pay for design (including its review),
304
+ implementation, checks and repair, leaving the reserved money and time intact.
305
+ After recording implementation from the completed native worker and fresh checks,
306
+ invoke `node .claude/nccgs/tools/task.mjs report --id TASK --outcome partial --summary "Awaiting protected independent review"`
307
+ before ending the work session. A prose PARTIAL response alone does not write the
308
+ lifecycle report. Do not dispatch the delivery reviewer inside the work phase.
309
+ The external supervisor launches the same task with
310
+ `--budget-phase final-review`. That phase may only dispatch independent delivery
311
+ reviewers and settle existing evidence; it cannot fund repair or new checks.
312
+ Read `task budget-status --id TASK` for the pinned terms and settled spend. A new
313
+ session does not reset either allocation. Unknown in-flight cost remains unknown.
314
+ If the final reviewer cannot finish, preserve PARTIAL; reserved funds are not a
315
+ review verdict or permission to reduce acceptance. Only the external operator
316
+ registers the plan before spending; a native worker/coordinator cannot edit it.
262
317
 
263
318
  Native capture follows the documented Claude Code [hook inputs and Agent tool
264
319
  response](https://code.claude.com/docs/en/hooks): resolvedModel/modelsUsed and native
@@ -269,5 +324,6 @@ Actual field availability and correlation must be confirmed by the real pilot.
269
324
 
270
325
  Framework tests and the synthetic five-size benchmark validate mechanics. They
271
326
  cannot measure model reasoning, game quality or end-to-end team productivity.
272
- Use [the pilot protocol](standalone-pilot.md) before stable promotion. CP0 remains
273
- reference-only; it is not a valid scored run for this purpose.
327
+ The [historical pilot protocol](standalone-pilot.md) describes benchmark controls.
328
+ Any qualification of this stable archive needs fresh scoped evidence; package
329
+ preparation does not establish it. CP0 remains reference-only and cannot be scored.
@@ -1,4 +1,4 @@
1
- # Standalone Claude Code execution — 2.0 RC
1
+ # Standalone Claude Code execution — 2.0.0
2
2
 
3
3
  Read `.claude/nccgs/MEMORY.md`. NCCGS means New Claude Code Game Studio. Only
4
4
  real Claude Code execution supplies NCCGS orchestration evidence. Codex maintenance,
@@ -73,6 +73,12 @@ dependent work; independent inspection may proceed.
73
73
 
74
74
  ## Reserve, execute, verify, review
75
75
 
76
+ When one implementation assignment is too broad, follow [task slices](task-slices.md).
77
+ Preview and pin bounded assignments inside the same task and total budget. Preserve
78
+ original criteria, reviewed rules and early checkpoints. Only final integration
79
+ can supply whole-task implementation; intermediate handoffs are not acceptance.
80
+ The independent reviewer must differ from all slice/repair contributors.
81
+
76
82
  The main Claude Code session coordinates. Reserve every worker before invoking
77
83
  Agent; do not delegate recursively. A reservation request contains a stable
78
84
  `requestKey`, `kind` (`implementation|analysis|review`), known `agent`, concrete
@@ -85,8 +91,12 @@ node .claude/nccgs/tools/task.mjs reserve --id TASK --request .nccgs/evidence/re
85
91
 
86
92
  Prefix the Agent prompt with `[NCCGS-DISPATCH:RETURNED_ID]`. Include the task's
87
93
  contract, route, owned paths, acceptance criteria and expected bounded handoff.
94
+ Use `task dispatch-prompt --id TASK --dispatch RETURNED_ID` through the plain
95
+ task CLI to generate that prompt and PARTIAL draft templates from the reservation.
96
+ This prepares an assignment without launching it or authoring evidence. The
97
+ worker writes its own handoff. See [handoff operations](../../../docs/HANDOFF-AUTOMATION.md).
88
98
  The pre-tool hook claims the reservation using the actual session/tool-use ID.
89
- Use foreground Agent calls for this preview. Launch distinct roles sequentially
99
+ Use foreground Agent calls in 2.0.0. Launch distinct roles sequentially
90
100
  through their start hooks; ambiguous start identities must not be guessed.
91
101
  Background Agent/Task calls are rejected.
92
102
  `nccgs run` also sets `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1` to prevent native
@@ -113,13 +123,16 @@ feedback; `purpose: "qa"` is a read-only QA/verification dispatch. Ordinary deli
113
123
  cannot consume the protected tail. Inspect `dispatch-status.deliveryBudget` and stop
114
124
  expansion before it runs out; more review rounds do not create more dispatch slots.
115
125
 
116
- Fresh repair reservations require a pinned `workPacket`, 1–4 exact existing source
117
- files and one fresh handoff path. Choose the correction before reserving; do not
126
+ Fresh repair reservations require a pinned `workPacket`, exact file ownership
127
+ and one fresh handoff path. Choose the correction before reserving; do not
118
128
  send an open-ended tuning investigation. `task dispatch-prompt --id TASK --dispatch ID`
119
129
  returns the bounded assignment; the launch hook injects the same prompt. Repair
120
- workers have at most 12 work tool calls (6 reads), 3 separate handoff writes and a
121
- 10-minute tool-admission deadline. Shell/MCP/web/delegation are blocked for these
122
- workers. The coordinator runs declared checks after return. See
130
+ schema-1 packets retain 1–4 existing files, 12 work calls (6 reads), 3 handoff writes
131
+ and a 10-minute admission deadline. Opt-in schema-2 unity-code/unity-editor packets
132
+ support exact new files or pinned Editor operations with profile-specific limits,
133
+ GUID preservation and project-wide exclusive ownership. Only the fixed
134
+ repair-editor wrapper may execute their pinned Unity CLI steps; general shell,
135
+ MCP, web and delegation remain blocked. The coordinator runs declared checks after return. See
123
136
  [bounded repair](bounded-repair.md) for packet fields and limitations.
124
137
  These limits do not add native turns or reset dispatch quota.
125
138
 
@@ -130,16 +143,23 @@ and use `job-status` or bounded `job-wait`. Reuse its receipt for QA and closure
130
143
  do not rerun successful checks just to capture evidence. A helper's arguments after
131
144
  `--` belong to the helper, including its own `--project`. Audit/plan/review
132
145
  workers use read tools and declared analysis artifacts; arbitrary shell and unknown
133
- MCP tools are blocked. If a required analysis check needs command execution,
146
+ MCP tools are blocked. A running non-repair worker may use only the fixed
147
+ `task handoff-validate` command for its own declared handoff; it checks structure
148
+ without executing arbitrary code or recording a stage. If a required analysis check needs command execution,
134
149
  provide externally run evidence or start a separately authorized implementation
135
150
  task. Do not loosen mode simply to bypass the guard.
136
151
 
137
152
  Record implementation/analysis with its completed `dispatchId`, current snapshot,
138
153
  checks, artifacts and captured runtime observation. Record independent review with
139
154
  a fresh completed review dispatch and explicit verdict/findings. The same dispatch
140
- cannot be consumed twice. Read `task inspect` and the task-gates schema documentation
141
- for exact payload fields in [standalone gates](standalone-gates.md). Missing observations block the relevant stage; never
142
- author runtime evidence to make it pass.
155
+ cannot be consumed twice. Read `task inspect` and the exact payload fields in
156
+ [standalone gates](standalone-gates.md). Missing observations block the relevant
157
+ stage; never author runtime evidence to make it pass.
158
+
159
+ For a completed reviewer-owned handoff, `task record-review --id TASK --dispatch ID
160
+ --file PATH` imports the exact pinned result through the same record gate. It
161
+ preserves negative verdicts, conditions, history and spent budgets. This command
162
+ is coordinator-only; it does not report success or close the task.
143
163
 
144
164
  ## Report and stop
145
165
 
@@ -182,6 +202,6 @@ invent missing native usage or release uncertain provider dispatches. A supervis
182
202
  session may yield while that external owner waits; an unsupervised premature Stop
183
203
  receives a bounded reminder to collect pending jobs. DONE still rejects pending jobs.
184
204
 
185
- This preview is ready for a fresh Claude Code pilot after framework fixture tests.
186
- It is not a completed real-runtime benchmark. Contaminated Vector Survivors CP0
205
+ A fresh full Unity qualification of the exact 2.0.0 archive remains separate from
206
+ framework fixture tests and frozen earlier-version qualifications. Contaminated Vector Survivors CP0
187
207
  must not be scored or presented as an independent NCCGS implementation.
@@ -21,7 +21,9 @@ Run the installed tool as `node .claude/nccgs/tools/task.mjs COMMAND ...`, or us
21
21
  4. `task snapshot` prints the current source fingerprint. It covers files, names,
22
22
  additions, and deletions, including untracked files. Top-level generated roots
23
23
  in pipeline.json and explicit Build/Builds output subdirectories from
24
- `.nccgs/inputs.json` are excluded. Requirements, decisions and registered canon
24
+ `.nccgs/inputs.json` are excluded. Opt-in exact `unityGeneratedFiles` paths are
25
+ also excluded from source, with their before/after hashes retained in managed
26
+ verification receipts. Requirements, decisions and registered canon
25
27
  are pinned separately and included in the snapshot. The plan and evidence files
26
28
  retain their own hashes. Never place source or canon in an excluded directory.
27
29
  5. `task ref --file .nccgs/evidence/check.log` prints a `{path, sha256}` reference.
@@ -120,6 +122,16 @@ YAML and Markdown links are not automatically followed. Do not register generate
120
122
  task/evidence folders as canonical inputs. Configure per-check `timeoutMs` and
121
123
  explicit build output subdirectories in the same manifest.
122
124
 
125
+ For a new Unity project, declare only known, wholly generated IDE/local metadata
126
+ files in `unityGeneratedFiles` before init. Use exact project-root `.csproj`,
127
+ `.sln`/`.slnx` paths, `.vscode/extensions.json`, `.vscode/launch.json`,
128
+ `.vscode/settings.json`, `UserSettings/EditorUserSettings.asset` or
129
+ `UserSettings/Search.settings`, as applicable. No folders or globs are accepted.
130
+ Do not declare user-owned IDE configuration or project files consumed as build
131
+ inputs; leave them tracked or register them as canonical inputs. Canonical/output
132
+ overlaps are rejected. This opt-in policy is itself pinned; adding exclusions
133
+ after a FAIL cannot make that old attempt pass or preserve stale approvals.
134
+
123
135
  After an approved input change, or for a 1.4 task lacking input pins, run
124
136
  `task refresh-inputs --id ID --reason TEXT`. This archives the old state, clears
125
137
  stages, retains review consumption, and requires fresh observations/checks and