nccgs 2.0.0 → 2.1.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/.claude/agents/nccgs-adversarial-reviewer.md +1 -1
- package/.claude/agents/nccgs-engine-programmer.md +1 -1
- package/.claude/agents/nccgs-fast-implementer.md +1 -1
- package/.claude/agents/nccgs-game-designer.md +1 -1
- package/.claude/agents/nccgs-gameplay-programmer.md +1 -1
- package/.claude/agents/nccgs-qa-engineer.md +1 -1
- package/.claude/agents/nccgs-task-scout.md +1 -1
- package/.claude/agents/nccgs-ui-programmer.md +1 -1
- package/.claude/agents/nccgs-unity-build-specialist.md +1 -1
- package/.claude/agents/nccgs-unity-implementer.md +1 -1
- package/.claude/agents/nccgs-unity-systems-specialist.md +1 -1
- package/.claude/agents/nccgs-unity-ui-specialist.md +1 -1
- package/.claude/agents/nccgs-verification-engineer.md +1 -1
- package/.claude/nccgs/MEMORY.md +9 -3
- package/.claude/nccgs/VERSION +1 -1
- package/.claude/nccgs/constitution.md +187 -176
- package/.claude/nccgs/hooks/closure-guard.mjs +2 -0
- package/.claude/nccgs/hooks/unity-transport-guard.mjs +11 -0
- package/.claude/nccgs/pipeline.json +260 -260
- package/.claude/nccgs/protocols/context-packets.md +5 -0
- package/.claude/nccgs/protocols/model-routing.md +46 -46
- package/.claude/nccgs/protocols/review-handoff.md +21 -1
- package/.claude/nccgs/protocols/shared-workflow-context.md +33 -0
- package/.claude/nccgs/protocols/unity-boundary.md +20 -0
- package/.claude/nccgs/routing.generated.md +4 -4
- package/.claude/nccgs/settings.fragment.json +84 -24
- package/.claude/nccgs/studio.json +53 -53
- package/.claude/nccgs/tools/autonomy.mjs +13 -0
- package/.claude/nccgs/tools/command-tokens.mjs +22 -0
- package/.claude/nccgs/tools/compile-policy.mjs +4 -0
- package/.claude/nccgs/tools/configure-models.mjs +4 -0
- package/.claude/nccgs/tools/hook-transport.mjs +34 -0
- package/.claude/nccgs/tools/installation-guard.mjs +55 -0
- package/.claude/nccgs/tools/native-completion.mjs +10 -1
- package/.claude/nccgs/tools/returned-handoff.mjs +11 -2
- package/.claude/nccgs/tools/shared-context-guard.mjs +60 -0
- package/.claude/nccgs/tools/shared-context.mjs +25 -0
- package/.claude/nccgs/tools/tool-guard.mjs +120 -131
- package/.claude/nccgs/tools/unity-transport.mjs +170 -0
- package/.claude/nccgs/workflow-catalog.json +4 -4
- package/CHANGELOG.md +235 -165
- package/CLAUDE.md +10 -8
- package/MEMORY.md +109 -56
- package/README.md +206 -168
- package/UPGRADING.md +130 -112
- package/VERSION +1 -1
- package/docs/ARCHITECTURE.md +131 -131
- package/docs/ASSET-PRODUCTION-GRAPHIFY-PLAN.md +230 -0
- package/docs/HUONG-DAN-MIGRATE-VA-SU-DUNG.md +117 -87
- package/docs/NCCGS-1.5.md +237 -237
- package/docs/PROJECT-POLICY.md +94 -94
- package/docs/RELEASE-STATUS.md +32 -7
- package/docs/UNINSTALL.md +134 -0
- package/docs/WFK17-HOOK-REPAIR.md +71 -0
- package/docs/WORKFLOWS.md +85 -85
- package/package.json +1 -1
- package/scaffold/.nccgs/project.yaml +109 -108
- package/scripts/benchmark-v15.mjs +173 -173
- package/scripts/cli.mjs +11 -2
- package/scripts/doctor.mjs +261 -261
- package/scripts/install.mjs +530 -515
- package/scripts/recover-session.mjs +89 -0
- package/scripts/run.mjs +22 -9
- package/scripts/supervise.mjs +4 -0
- package/scripts/uninstall.mjs +292 -0
- package/scripts/validate.mjs +285 -278
- package/tests/autonomy.test.mjs +126 -113
- package/tests/design-readiness.test.mjs +199 -199
- package/tests/fixtures/compiler-shutdown.cs +67 -64
- package/tests/fixtures/native-provider.mjs +61 -0
- package/tests/framework.test.mjs +740 -740
- package/tests/hook-repair.test.mjs +106 -0
- package/tests/lifecycle-v15.test.mjs +346 -300
- package/tests/native-completion-notices.test.mjs +181 -0
- package/tests/phase1.test.mjs +427 -416
- package/tests/phase2.test.mjs +250 -250
- package/tests/policy-v15.test.mjs +234 -234
- package/tests/returned-handoff-notices.test.mjs +170 -0
- package/tests/runtime-v15.test.mjs +1197 -1191
- package/tests/task-slices.test.mjs +285 -285
- package/tests/uninstall.test.mjs +477 -0
- package/tests/unity-transport.test.mjs +348 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import crypto from "node:crypto";
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { permissionModeArgs } from "../../.claude/nccgs/tools/autonomy.mjs";
|
|
7
|
+
import { unityCliMcpArgs } from "../../.claude/nccgs/tools/unity-transport.mjs";
|
|
8
|
+
|
|
9
|
+
// SYNTHETIC FIXTURE ONLY, never Claude/provider evidence. The supervisor spawns
|
|
10
|
+
// this launcher directly with the real canonical provider argv (owned permission
|
|
11
|
+
// prefix, strict MCP isolation, validated config, then supervisor lifecycle
|
|
12
|
+
// flags). The launcher forwards that argv unchanged to a Node fixture script, so
|
|
13
|
+
// production canonical validation needs no exception for fake providers.
|
|
14
|
+
const windowsSource = `using System; using System.Diagnostics; using System.Text;
|
|
15
|
+
static class NccgsNativeProviderFixture {
|
|
16
|
+
static string Quote(string a) {
|
|
17
|
+
if (a.Length > 0 && a.IndexOfAny(new[] { ' ', '\\t', '"' }) < 0) return a;
|
|
18
|
+
var b = new StringBuilder("\\""); int slashes = 0;
|
|
19
|
+
foreach (char c in a) {
|
|
20
|
+
if (c == '\\\\') { slashes++; continue; }
|
|
21
|
+
if (c == '"') { b.Append('\\\\', slashes * 2 + 1); b.Append('"'); } else { b.Append('\\\\', slashes); b.Append(c); }
|
|
22
|
+
slashes = 0;
|
|
23
|
+
}
|
|
24
|
+
b.Append('\\\\', slashes * 2); b.Append('"'); return b.ToString();
|
|
25
|
+
}
|
|
26
|
+
static int Main(string[] args) {
|
|
27
|
+
var line = new StringBuilder(Quote(Environment.GetEnvironmentVariable("NCCGS_FIXTURE_SCRIPT")));
|
|
28
|
+
foreach (var a in args) line.Append(' ').Append(Quote(a));
|
|
29
|
+
var info = new ProcessStartInfo(Environment.GetEnvironmentVariable("NCCGS_FIXTURE_NODE"), line.ToString()) { UseShellExecute = false };
|
|
30
|
+
using (var p = Process.Start(info)) { p.WaitForExit(); return p.ExitCode; }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
const posixSource = `#!/bin/sh\nexec "$NCCGS_FIXTURE_NODE" "$NCCGS_FIXTURE_SCRIPT" "$@"\n`;
|
|
35
|
+
|
|
36
|
+
function launcher() {
|
|
37
|
+
const windows = process.platform === "win32", source = windows ? windowsSource : posixSource;
|
|
38
|
+
const directory = path.join(os.tmpdir(), "nccgs-native-provider-fixture", crypto.createHash("sha256").update(source).digest("hex"));
|
|
39
|
+
const binary = path.join(directory, windows ? "provider-fixture.exe" : "provider-fixture");
|
|
40
|
+
if (fs.existsSync(binary)) return binary;
|
|
41
|
+
fs.mkdirSync(directory, { recursive: true });
|
|
42
|
+
const temporary = path.join(directory, `${crypto.randomUUID()}${windows ? ".exe" : ""}`);
|
|
43
|
+
if (windows) {
|
|
44
|
+
const sourceFile = path.join(directory, `${crypto.randomUUID()}.cs`);
|
|
45
|
+
fs.writeFileSync(sourceFile, source);
|
|
46
|
+
const compiler = path.join(process.env.SystemRoot || "C:/Windows", "Microsoft.NET/Framework64/v4.0.30319/csc.exe");
|
|
47
|
+
const result = spawnSync(compiler, ["/nologo", "/target:exe", `/out:${temporary}`, sourceFile], { encoding: "utf8", windowsHide: true, timeout: 30000 });
|
|
48
|
+
fs.rmSync(sourceFile, { force: true });
|
|
49
|
+
if (result.status !== 0 || result.error) throw new Error(`Cannot compile provider fixture launcher: ${result.error?.message || result.stdout || result.stderr}`);
|
|
50
|
+
} else fs.writeFileSync(temporary, source, { mode: 0o755 });
|
|
51
|
+
try { fs.renameSync(temporary, binary); }
|
|
52
|
+
catch (error) { if (!fs.existsSync(binary)) throw error; fs.rmSync(temporary, { force: true }); }
|
|
53
|
+
return binary;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Returns a supervise() plan fragment whose args come from the production
|
|
57
|
+
// launch builder for the given autonomy mode.
|
|
58
|
+
export function nativeProvider(project, script, { mode = "full", env = process.env, forwarded = [] } = {}) {
|
|
59
|
+
return { binary: launcher(), mode, args: unityCliMcpArgs(forwarded, project, permissionModeArgs(mode)),
|
|
60
|
+
env: { ...env, NCCGS_FIXTURE_NODE: process.execPath, NCCGS_FIXTURE_SCRIPT: script } };
|
|
61
|
+
}
|