@ornexus/neocortex 4.60.71 → 4.60.73
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/release-source.json +1 -1
- package/dist/sbom.cdx.json +1211 -1217
- package/install.ps1 +1 -1
- package/install.sh +1 -1
- package/package.json +2 -2
- package/packages/client/dist/adapters/adapter-registry.js +108 -1
- package/packages/client/dist/adapters/antigravity-adapter.js +77 -2
- package/packages/client/dist/adapters/claude-code-adapter.js +79 -3
- package/packages/client/dist/adapters/codex-adapter.js +80 -2
- package/packages/client/dist/adapters/cursor-adapter.js +115 -4
- package/packages/client/dist/adapters/gemini-adapter.js +71 -2
- package/packages/client/dist/adapters/grok-adapter.js +42 -2
- package/packages/client/dist/adapters/index.js +22 -1
- package/packages/client/dist/adapters/platform-detector.js +212 -1
- package/packages/client/dist/adapters/target-adapter.js +12 -0
- package/packages/client/dist/adapters/vscode-adapter.js +72 -2
- package/packages/client/dist/agent/refresh-stubs.js +417 -2
- package/packages/client/dist/agent/update-agent-yaml.js +102 -1
- package/packages/client/dist/agent/update-description.js +251 -1
- package/packages/client/dist/cache/crypto-utils.js +78 -1
- package/packages/client/dist/cache/encrypted-cache.js +108 -1
- package/packages/client/dist/cache/in-memory-asset-cache.js +73 -1
- package/packages/client/dist/cache/index.js +13 -1
- package/packages/client/dist/cache/protected-pi-boundary.js +44 -1
- package/packages/client/dist/checkpoint/checkpoint-client-reader.js +127 -2
- package/packages/client/dist/checkpoint/index.js +11 -1
- package/packages/client/dist/checkpoint/shared-checkpoint-types.js +32 -1
- package/packages/client/dist/cli.js +358 -5
- package/packages/client/dist/commands/activate.js +394 -8
- package/packages/client/dist/commands/architecture-answers.js +274 -7
- package/packages/client/dist/commands/architecture-memory-terminal.js +253 -4
- package/packages/client/dist/commands/architecture-non-ui-continuation.js +100 -1
- package/packages/client/dist/commands/architecture-root-binding.js +51 -1
- package/packages/client/dist/commands/cache-status.js +112 -2
- package/packages/client/dist/commands/config.js +88 -1
- package/packages/client/dist/commands/doctor.js +635 -2
- package/packages/client/dist/commands/invoke.js +7200 -143
- package/packages/client/dist/commands/legacy-epic-terminal.js +71 -1
- package/packages/client/dist/commands/legacy-story-branch.js +96 -1
- package/packages/client/dist/commands/legacy-story-pr.js +276 -1
- package/packages/client/dist/commands/mutation-qa-checkpoint.js +285 -5
- package/packages/client/dist/commands/mutation-qa-gate.js +54 -1
- package/packages/client/dist/commands/mutation-qa-git.js +41 -1
- package/packages/client/dist/commands/mutation-qa-policy.js +102 -1
- package/packages/client/dist/commands/mutation-qa-run.js +219 -3
- package/packages/client/dist/commands/mutation-qa-verdict.js +149 -1
- package/packages/client/dist/commands/mutation-qa.js +220 -1
- package/packages/client/dist/commands/native-agent.js +136 -2
- package/packages/client/dist/commands/planning-diagnosis.js +43 -1
- package/packages/client/dist/commands/planning-generation.js +53 -1
- package/packages/client/dist/commands/planning-memory.js +40 -1
- package/packages/client/dist/commands/planning-research.js +42 -1
- package/packages/client/dist/commands/private-session.js +75 -1
- package/packages/client/dist/commands/property-qa.js +139 -1
- package/packages/client/dist/commands/qa-control.js +16 -1
- package/packages/client/dist/commands/qa-scan-browser-launch.js +55 -1
- package/packages/client/dist/commands/qa-scan-browser-route.js +28 -1
- package/packages/client/dist/commands/qa-scan-capture.js +663 -5
- package/packages/client/dist/commands/qa-scan-discovery.js +376 -3
- package/packages/client/dist/commands/qa-scan-review.js +826 -5
- package/packages/client/dist/commands/qa-synthetic-backend-capture.js +266 -1
- package/packages/client/dist/commands/qa-synthetic-backend-review.js +297 -1
- package/packages/client/dist/commands/qa-synthetic-backend.js +340 -2
- package/packages/client/dist/commands/qa-synthetic-broker-port.js +85 -1
- package/packages/client/dist/commands/qa-synthetic-browser.js +39 -1
- package/packages/client/dist/commands/refactor-characterization.js +671 -21
- package/packages/client/dist/commands/refactor-commit.js +399 -13
- package/packages/client/dist/commands/refactor-control.js +142 -3
- package/packages/client/dist/commands/refactor-cpp-assertions.js +93 -3
- package/packages/client/dist/commands/refactor-review.js +283 -5
- package/packages/client/dist/commands/refactor-root.js +588 -7
- package/packages/client/dist/commands/refresh-memory.js +156 -3
- package/packages/client/dist/commands/shared-architecture-non-ui.js +24 -1
- package/packages/client/dist/commands/story-checkpoint.js +171 -1
- package/packages/client/dist/config/profile-directory.js +13 -1
- package/packages/client/dist/config/resolver-selection.js +278 -1
- package/packages/client/dist/config/secure-config.js +281 -12
- package/packages/client/dist/config.js +223 -2
- package/packages/client/dist/constants.js +25 -1
- package/packages/client/dist/context/context-collector.js +222 -2
- package/packages/client/dist/context/context-sanitizer.js +145 -1
- package/packages/client/dist/continuity/autonomous-governance.js +285 -1
- package/packages/client/dist/continuity/continuity-client-state-store.js +1587 -1
- package/packages/client/dist/continuity/invoke-hooks.js +129 -1
- package/packages/client/dist/continuity/migrations/001-initial-schema.js +12 -2
- package/packages/client/dist/continuity/migrations/002-processing-output-summary-indexes.js +12 -2
- package/packages/client/dist/continuity/migrations/003-headless-execution-attempts.js +12 -2
- package/packages/client/dist/continuity/migrations/004-outbox-delivery-state.js +12 -2
- package/packages/client/dist/continuity/migrations/005-bounded-headless-queue.js +12 -2
- package/packages/client/dist/continuity/migrations/006-native-agent-dispatches.js +10 -2
- package/packages/client/dist/continuity/native-agent-store.js +69 -1
- package/packages/client/dist/continuity/native-agent-types.js +90 -1
- package/packages/client/dist/continuity/outbox.js +117 -1
- package/packages/client/dist/continuity/runner-bootstrap-policy.js +172 -1
- package/packages/client/dist/continuity/sqlite-store.d.ts +22 -1
- package/packages/client/dist/continuity/sqlite-store.js +2612 -81
- package/packages/client/dist/effects/invoke-effect-gateways.js +62 -1
- package/packages/client/dist/errors/error-messages.js +228 -2
- package/packages/client/dist/errors/frontmatter-diagnostics.js +125 -1
- package/packages/client/dist/evidence/collector.js +347 -1
- package/packages/client/dist/evidence/index.js +1 -1
- package/packages/client/dist/evidence/types.js +2 -0
- package/packages/client/dist/fs/atomic-state-replace.js +152 -1
- package/packages/client/dist/generated/command-registry.generated.js +4076 -1
- package/packages/client/dist/generated/public-projections.generated.js +149 -1
- package/packages/client/dist/git/direct-yolo-c01-retry.js +138 -4
- package/packages/client/dist/git/direct-yolo-checkpoint.js +1234 -4
- package/packages/client/dist/git/epic-operational-state.d.ts +198 -0
- package/packages/client/dist/git/epic-operational-state.js +672 -0
- package/packages/client/dist/git/git-lifecycle-step-ids.js +14 -1
- package/packages/client/dist/git/git-lifecycle-store.d.ts +9 -1
- package/packages/client/dist/git/git-lifecycle-store.js +1981 -9
- package/packages/client/dist/git/legacy-story-branch-checkpoint.js +259 -9
- package/packages/client/dist/git/legacy-story-branch-setup.js +348 -4
- package/packages/client/dist/git/legacy-story-pr.js +3538 -70
- package/packages/client/dist/git/secure-filesystem-boundary.js +182 -5
- package/packages/client/dist/graph-retrieval/pre-command-hook.js +284 -1
- package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.js +237 -1
- package/packages/client/dist/i18n/first-run.js +60 -2
- package/packages/client/dist/index.js +47 -1
- package/packages/client/dist/invocation/invoke-input.js +24 -1
- package/packages/client/dist/license/index.js +5 -1
- package/packages/client/dist/license/license-client.js +304 -1
- package/packages/client/dist/machine/fingerprint.js +163 -2
- package/packages/client/dist/machine/index.js +5 -1
- package/packages/client/dist/memory/project-memory-path-scope.js +62 -1
- package/packages/client/dist/memory/project-memory-writer.js +1007 -40
- package/packages/client/dist/memory/shared-project-memory-types.js +253 -2
- package/packages/client/dist/migrations/epic-lifecycle-backfill.d.ts +97 -0
- package/packages/client/dist/migrations/epic-lifecycle-backfill.js +1060 -0
- package/packages/client/dist/migrations/project-identity-capability.js +50 -1
- package/packages/client/dist/migrations/project-identity.js +493 -7
- package/packages/client/dist/migrations/state-json.d.ts +22 -0
- package/packages/client/dist/migrations/state-json.js +393 -4
- package/packages/client/dist/policy/architecture-policy.js +184 -2
- package/packages/client/dist/policy/index.js +7 -1
- package/packages/client/dist/policy/shared-policy-types.js +38 -0
- package/packages/client/dist/policy/subagent-approval-policy.js +55 -1
- package/packages/client/dist/private-execution/clean-baseline.js +279 -2
- package/packages/client/dist/private-execution/codex-executor.js +574 -4
- package/packages/client/dist/private-execution/codex-host-runtime.js +137 -1
- package/packages/client/dist/private-execution/codex-lifecycle-guard.js +97 -1
- package/packages/client/dist/private-execution/codex-scoped-permissions.js +128 -1
- package/packages/client/dist/private-execution/delivery.js +410 -13
- package/packages/client/dist/private-execution/diagnosis-root-review.js +294 -2
- package/packages/client/dist/private-execution/frozen-handoff.js +19 -6
- package/packages/client/dist/private-execution/implementation-validation.js +106 -2
- package/packages/client/dist/private-execution/isolated-admission.js +1432 -23
- package/packages/client/dist/private-execution/isolated-session.js +725 -5
- package/packages/client/dist/private-execution/isolated-workspace.js +122 -1
- package/packages/client/dist/private-execution/pact-consumer-runtime.js +409 -3
- package/packages/client/dist/private-execution/pact-test-source.js +258 -1
- package/packages/client/dist/private-execution/pact-toolchain.js +290 -3
- package/packages/client/dist/private-execution/pact-write-set.js +172 -1
- package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.js +406 -5
- package/packages/client/dist/private-execution/planning-generation-checkpoint.js +462 -5
- package/packages/client/dist/private-execution/planning-memory-checkpoint.js +139 -3
- package/packages/client/dist/private-execution/planning-research-checkpoint.js +325 -4
- package/packages/client/dist/private-execution/private-report-store.js +42 -1
- package/packages/client/dist/private-execution/property-test-candidate.js +103 -1
- package/packages/client/dist/private-execution/property-test-choices.js +147 -3
- package/packages/client/dist/private-execution/property-test-plan.js +271 -7
- package/packages/client/dist/private-execution/property-test-review.js +258 -4
- package/packages/client/dist/private-execution/property-test-runtime.js +372 -9
- package/packages/client/dist/private-execution/property-test-source.js +139 -1
- package/packages/client/dist/private-execution/root-checkpoint.js +80 -1
- package/packages/client/dist/private-execution/root-memory-git-evidence.js +135 -3
- package/packages/client/dist/private-execution/root-memory-recovery.js +93 -1
- package/packages/client/dist/private-execution/root-memory-request.js +29 -1
- package/packages/client/dist/private-execution/root-memory-scope.js +178 -1
- package/packages/client/dist/private-execution/root-memory-writer.js +102 -1
- package/packages/client/dist/private-execution/session-lease.js +63 -1
- package/packages/client/dist/private-execution/shared-private-admission-types.js +50 -1
- package/packages/client/dist/private-execution/shared-project-validation.js +66 -1
- package/packages/client/dist/private-execution/shared-root-memory-types.js +61 -1
- package/packages/client/dist/private-execution/ux-source-validation.js +372 -1
- package/packages/client/dist/private-execution/ux-write-set.js +191 -2
- package/packages/client/dist/registry/registry-reconciliation.js +234 -1
- package/packages/client/dist/resilience/circuit-breaker.js +170 -1
- package/packages/client/dist/resilience/degradation-manager.js +164 -1
- package/packages/client/dist/resilience/freshness-indicator.js +100 -1
- package/packages/client/dist/resilience/index.js +8 -1
- package/packages/client/dist/resilience/recovery-detector.js +74 -1
- package/packages/client/dist/resolvers/asset-resolver.js +13 -0
- package/packages/client/dist/resolvers/local-resolver.js +255 -8
- package/packages/client/dist/resolvers/remote-resolver.js +233 -1
- package/packages/client/dist/runner/binary.js +404 -1
- package/packages/client/dist/runner/cli.js +1571 -17
- package/packages/client/dist/runner/headless/adapters.js +49 -1
- package/packages/client/dist/runner/headless/claude-code-adapter.js +79 -1
- package/packages/client/dist/runner/headless/continuous-story-workspace.js +1628 -11
- package/packages/client/dist/runner/headless/epic-git-reconciliation-inventory.js +69 -1
- package/packages/client/dist/runner/headless/epic-merge-candidate-qa.js +110 -2
- package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.js +1236 -8
- package/packages/client/dist/runner/headless/epic-terminal-git-runner.js +318 -2
- package/packages/client/dist/runner/headless/fake-adapter.js +62 -1
- package/packages/client/dist/runner/headless/managed-profile.js +132 -1
- package/packages/client/dist/runner/headless/opencode-adapter.js +145 -2
- package/packages/client/dist/runner/headless/prepared-story-bundle.js +43 -1
- package/packages/client/dist/runner/headless/resolver.js +231 -1
- package/packages/client/dist/runner/headless/run-yolo.js +885 -1
- package/packages/client/dist/runner/headless/run-yoloop.js +2574 -2
- package/packages/client/dist/runner/headless/types.js +574 -2
- package/packages/client/dist/runner/local-console.js +396 -13
- package/packages/client/dist/runner/portal-sync-worker.js +1487 -1
- package/packages/client/dist/runner/project-identity.js +106 -1
- package/packages/client/dist/runner/scheduler.js +995 -7
- package/packages/client/dist/runner-cli.js +18 -2
- package/packages/client/dist/state/invocation-shape.js +13 -1
- package/packages/client/dist/state/project-state-snapshot.d.ts +8 -0
- package/packages/client/dist/state/project-state-snapshot.js +1731 -1
- package/packages/client/dist/state/state-json-repair.js +785 -3
- package/packages/client/dist/state/structural-dag-projection.js +118 -1
- package/packages/client/dist/telemetry/index.js +5 -1
- package/packages/client/dist/telemetry/offline-queue.js +131 -1
- package/packages/client/dist/tier/index.js +5 -1
- package/packages/client/dist/tier/tier-aware-client.js +405 -1
- package/packages/client/dist/types/index.js +38 -1
- package/packages/client/dist/version.js +27 -1
- package/packages/client/dist/yolo/change-evidence-collector.js +126 -1
- package/packages/client/dist/yolo/invoke-envelope-capability.js +62 -1
- package/packages/client/dist/yolo/spec-envelope-collector.js +184 -5
- package/packages/client/dist/yoloop/discovery-hook.js +300 -2
- package/packages/client/dist/yoloop/index.js +8 -1
- package/packages/client/dist/yoloop/invoke-hooks.js +669 -12
- package/packages/client/dist/yoloop/shared-discover-epics.js +1007 -1
- package/packages/client/dist/yoloop/shared-yoloop-types.d.ts +65 -1
- package/packages/client/dist/yoloop/shared-yoloop-types.js +33 -1
- package/packages/client/dist/yoloop/target-normalization.js +180 -1
- package/packages/client/dist/yoloop/yoloop-client-state-store.d.ts +8 -0
- package/packages/client/dist/yoloop/yoloop-client-state-store.js +1920 -1
- package/packages/shared/dist/yolo/spec-envelope.js +3 -6
- package/targets-stubs/antigravity/gemini.md +1 -1
- package/targets-stubs/antigravity/skill/SKILL.md +1 -1
- package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex-root.md +2 -2
- package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex.md +2 -2
- package/targets-stubs/codex/AGENTS.md +1 -1
- package/targets-stubs/cursor/agent.md +2 -2
- package/targets-stubs/gemini-cli/agent.md +2 -2
- package/targets-stubs/opencode/neocortex-root.md +1 -1
- package/targets-stubs/vscode/neocortex.agent.md +2 -2
|
@@ -1 +1,149 @@
|
|
|
1
|
-
|
|
1
|
+
/** Generated by scripts/generate-public-catalog-projections.mjs. Do not edit. */
|
|
2
|
+
export const PUBLIC_PROJECTION_BUNDLE = {
|
|
3
|
+
"schemaVersion": "PublicProjectionBundle/1.0",
|
|
4
|
+
"generationId": "sha256:12838b51552e283fadffcea062246c8a0ca3b89353ccc01ce42b91361de6e0e9",
|
|
5
|
+
"sourceHash": "12838b51552e283fadffcea062246c8a0ca3b89353ccc01ce42b91361de6e0e9",
|
|
6
|
+
"catalogHash": "78c0271523e9a7dab978370cf6fc9c4abb3692b7fd21b9e8118bff1886b8fa19",
|
|
7
|
+
"publicProjectionHash": "e5022ae52f9241a51faab0e1d6f64c953e402fecaabac2d384298376dc14002d",
|
|
8
|
+
"stageProjectionHash": "f9875354257eb62be4509cd5cbf0b8e5e214a7414e82b8a8e45bc2baea6f0477",
|
|
9
|
+
"compilationHash": "82aeb4d0dceff6954222b15e35f9baf1d0eab7b14b6a994daaa7e7d793d65626",
|
|
10
|
+
"registry": {
|
|
11
|
+
"version": "1.0.0",
|
|
12
|
+
"checksum": "184a2d616e0734fd3173d60889d74bae031280513831ec1f0a3a8c36959d2994"
|
|
13
|
+
},
|
|
14
|
+
"artifacts": [
|
|
15
|
+
{
|
|
16
|
+
"kind": "catalog",
|
|
17
|
+
"schemaVersion": "ExecutableGraphCatalogPublicProjection/1.0",
|
|
18
|
+
"relativePath": "catalog.json",
|
|
19
|
+
"sha256": "47bfe074c0e3094296bae58393c801a745b102d548099596ccb3d8e419a3e738",
|
|
20
|
+
"entryCount": 97,
|
|
21
|
+
"generationId": "sha256:12838b51552e283fadffcea062246c8a0ca3b89353ccc01ce42b91361de6e0e9"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"kind": "commands",
|
|
25
|
+
"schemaVersion": "CommandRegistryPublicProjection/1.0",
|
|
26
|
+
"relativePath": "commands.json",
|
|
27
|
+
"sha256": "907c009c7b10ad01eadb7a7f603af8759f348fe444af98a24c4558117bd09146",
|
|
28
|
+
"entryCount": 62,
|
|
29
|
+
"generationId": "sha256:12838b51552e283fadffcea062246c8a0ca3b89353ccc01ce42b91361de6e0e9"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"kind": "progress-view",
|
|
33
|
+
"schemaVersion": "ProgressViewContractProjection/1.0",
|
|
34
|
+
"relativePath": "progress-view.json",
|
|
35
|
+
"sha256": "96f6ca2d3948891efe31fceb031001428190d31cbbbf1bf53446fcaf3be31fbb",
|
|
36
|
+
"entryCount": 1,
|
|
37
|
+
"generationId": "sha256:12838b51552e283fadffcea062246c8a0ca3b89353ccc01ce42b91361de6e0e9"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"kind": "stages",
|
|
41
|
+
"schemaVersion": "ExecutableGraphStageProjection/1.0",
|
|
42
|
+
"relativePath": "stages.json",
|
|
43
|
+
"sha256": "5444c07f918f6b6760d8ba1161a66a7635841dac0da3a52ddb95c600e33e9700",
|
|
44
|
+
"entryCount": 85,
|
|
45
|
+
"generationId": "sha256:12838b51552e283fadffcea062246c8a0ca3b89353ccc01ce42b91361de6e0e9"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"kind": "surfaces",
|
|
49
|
+
"schemaVersion": "PublicProjectionSurfaces/1.0",
|
|
50
|
+
"relativePath": "surfaces.json",
|
|
51
|
+
"sha256": "38b6f572e04f77d0fd8f22bdd43ffd67d7c763e28301160342cd228321f631e6",
|
|
52
|
+
"entryCount": 6,
|
|
53
|
+
"generationId": "sha256:12838b51552e283fadffcea062246c8a0ca3b89353ccc01ce42b91361de6e0e9"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"compatibility": {
|
|
57
|
+
"status": "compatible",
|
|
58
|
+
"routeCount": 97,
|
|
59
|
+
"rootCommandCount": 62,
|
|
60
|
+
"operationCount": 35,
|
|
61
|
+
"aliasCount": 199
|
|
62
|
+
},
|
|
63
|
+
"contractVersions": {
|
|
64
|
+
"catalog": "ExecutableGraphCatalogPublicProjection/1.0",
|
|
65
|
+
"stages": "ExecutableGraphStageProjection/1.0",
|
|
66
|
+
"progress": "ProgressSnapshot/1.0",
|
|
67
|
+
"progressView": "ProgressView/1.0",
|
|
68
|
+
"readiness": "ExecutableGraphReadinessVector/1.0",
|
|
69
|
+
"validation": "ValidationMatrix/1.1"
|
|
70
|
+
},
|
|
71
|
+
"surfaces": [
|
|
72
|
+
{
|
|
73
|
+
"kind": "admin",
|
|
74
|
+
"artifactKinds": [
|
|
75
|
+
"catalog",
|
|
76
|
+
"stages",
|
|
77
|
+
"commands",
|
|
78
|
+
"surfaces",
|
|
79
|
+
"progress-view"
|
|
80
|
+
],
|
|
81
|
+
"progressView": "ProgressView/1.0",
|
|
82
|
+
"authority": "read-only-projection"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"kind": "client",
|
|
86
|
+
"artifactKinds": [
|
|
87
|
+
"catalog",
|
|
88
|
+
"stages",
|
|
89
|
+
"commands",
|
|
90
|
+
"surfaces",
|
|
91
|
+
"progress-view"
|
|
92
|
+
],
|
|
93
|
+
"progressView": "ProgressView/1.0",
|
|
94
|
+
"authority": "read-only-projection"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"kind": "docs",
|
|
98
|
+
"artifactKinds": [
|
|
99
|
+
"catalog",
|
|
100
|
+
"stages",
|
|
101
|
+
"commands",
|
|
102
|
+
"surfaces",
|
|
103
|
+
"progress-view"
|
|
104
|
+
],
|
|
105
|
+
"progressView": "ProgressView/1.0",
|
|
106
|
+
"authority": "read-only-projection"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"kind": "metrics",
|
|
110
|
+
"artifactKinds": [
|
|
111
|
+
"catalog",
|
|
112
|
+
"stages",
|
|
113
|
+
"commands",
|
|
114
|
+
"surfaces",
|
|
115
|
+
"progress-view"
|
|
116
|
+
],
|
|
117
|
+
"progressView": "ProgressView/1.0",
|
|
118
|
+
"authority": "read-only-projection"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"kind": "runtime-preview",
|
|
122
|
+
"artifactKinds": [
|
|
123
|
+
"catalog",
|
|
124
|
+
"stages",
|
|
125
|
+
"commands",
|
|
126
|
+
"surfaces",
|
|
127
|
+
"progress-view"
|
|
128
|
+
],
|
|
129
|
+
"progressView": "ProgressView/1.0",
|
|
130
|
+
"authority": "read-only-projection"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"kind": "tests",
|
|
134
|
+
"artifactKinds": [
|
|
135
|
+
"catalog",
|
|
136
|
+
"stages",
|
|
137
|
+
"commands",
|
|
138
|
+
"surfaces",
|
|
139
|
+
"progress-view"
|
|
140
|
+
],
|
|
141
|
+
"progressView": "ProgressView/1.0",
|
|
142
|
+
"authority": "read-only-projection"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"publicSafe": true,
|
|
146
|
+
"bundleHash": "9a6fd0a7a924a3a1f0406dc607e1c2a1c8a05f5efd55af24de6cb0f3bac25ab5"
|
|
147
|
+
};
|
|
148
|
+
export const PUBLIC_PROJECTION_GENERATION_ID = PUBLIC_PROJECTION_BUNDLE.generationId;
|
|
149
|
+
export const PUBLIC_PROJECTION_BUNDLE_HASH = PUBLIC_PROJECTION_BUNDLE.bundleHash;
|
|
@@ -1,4 +1,138 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/** Audited restart of a pre-implementation epic story after its private C01 session was lost. */
|
|
2
|
+
import { execFileSync } from 'node:child_process';
|
|
3
|
+
import { createHash, randomBytes } from 'node:crypto';
|
|
4
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { join, resolve } from 'node:path';
|
|
6
|
+
import { acquireGitLifecyclePhysicalIntegrationLock, assertGitLifecyclePrivateFile, ensureGitLifecyclePrivateChildDirectory, gitLifecycleRuntimeDirectory, readGitLifecycleRuntime, releaseGitLifecyclePhysicalIntegrationLock, } from './git-lifecycle-store.js';
|
|
7
|
+
// Server-owned step identifiers stay outside the published client bundle.
|
|
8
|
+
const COMPLETED_BEFORE_IMPLEMENTATION_SHA256 = [
|
|
9
|
+
'809db253d486b5d2620d318666219e8a2b4df05016174ba3c8a33fa17b65802a',
|
|
10
|
+
'50224b193dae7ba2a066e54f7091d2656302b849ea7a145a3a4c556d85f3fe3c',
|
|
11
|
+
'f757f6bf1182f23e5d7acbe47cbce9f0fa12f211d290b486892c6722bc42b4e8',
|
|
12
|
+
'9cd927d02ff5979b5077e75b09cb34be275eca0e1c955403235b9ba0fb7a55eb',
|
|
13
|
+
'a3f880e8d5bca9158a88c46f88754c0948237a3e8516c83a762ba1ee22c27d46',
|
|
14
|
+
];
|
|
15
|
+
function git(root, args) {
|
|
16
|
+
const env = { ...process.env };
|
|
17
|
+
for (const key of ['GIT_DIR', 'GIT_WORK_TREE', 'GIT_INDEX_FILE', 'GIT_COMMON_DIR', 'GIT_NAMESPACE'])
|
|
18
|
+
delete env[key];
|
|
19
|
+
return execFileSync('git', [...args], { cwd: root, env, encoding: 'utf8',
|
|
20
|
+
stdio: ['ignore', 'pipe', 'pipe'], timeout: 30_000, maxBuffer: 16 * 1024 * 1024 }).trim();
|
|
21
|
+
}
|
|
22
|
+
function digest(value) { return createHash('sha256').update(value).digest('hex'); }
|
|
23
|
+
function record(value) {
|
|
24
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : undefined;
|
|
25
|
+
}
|
|
26
|
+
/** No mutation: require missing private session, expired lease, clean Git, and exact C01-C05 progress. */
|
|
27
|
+
export async function inspectDirectYoloC01Retry(projectRoot, storyId) {
|
|
28
|
+
const root = resolve(projectRoot);
|
|
29
|
+
if (!/^[A-Za-z][A-Za-z0-9_-]*\.[A-Za-z0-9._-]+$/.test(storyId))
|
|
30
|
+
throw new Error('direct-yolo-retry-story-invalid');
|
|
31
|
+
const epicId = storyId.split('.')[0];
|
|
32
|
+
const head = git(root, ['rev-parse', 'HEAD']);
|
|
33
|
+
const branch = git(root, ['symbolic-ref', '--quiet', '--short', 'HEAD']);
|
|
34
|
+
if (git(root, ['status', '--porcelain=v1', '--untracked-files=all']))
|
|
35
|
+
throw new Error('direct-yolo-retry-checkout-dirty');
|
|
36
|
+
const stateText = readFileSync(join(root, '.neocortex/state.json'), 'utf8');
|
|
37
|
+
const state = record(JSON.parse(stateText));
|
|
38
|
+
const story = record(record(state?.stories)?.[storyId]);
|
|
39
|
+
const epic = record(record(state?.epics)?.[epicId]);
|
|
40
|
+
if (!story || !epic || story.epic_id !== epicId || epic.branch_mode !== 'epic'
|
|
41
|
+
|| epic.execution_branch !== branch || branch !== `epic/${epicId}`)
|
|
42
|
+
throw new Error('direct-yolo-retry-story-binding-invalid');
|
|
43
|
+
const steps = story.steps_completed;
|
|
44
|
+
if (story.status !== 'create-tasks' || typeof story.last_step !== 'string'
|
|
45
|
+
|| digest(story.last_step) !== COMPLETED_BEFORE_IMPLEMENTATION_SHA256.at(-1)
|
|
46
|
+
|| story.branch_name !== branch || !Array.isArray(steps)
|
|
47
|
+
|| steps.length !== COMPLETED_BEFORE_IMPLEMENTATION_SHA256.length
|
|
48
|
+
|| steps.some((step, index) => typeof step !== 'string'
|
|
49
|
+
|| digest(step) !== COMPLETED_BEFORE_IMPLEMENTATION_SHA256[index])
|
|
50
|
+
|| story.checkpoint || story.pr_number)
|
|
51
|
+
throw new Error('direct-yolo-retry-progress-ineligible');
|
|
52
|
+
const runtime = await readGitLifecycleRuntime(root, { required: true });
|
|
53
|
+
const runtimeEpic = record(runtime.epics[epicId]);
|
|
54
|
+
const lease = record(runtimeEpic?.branch_lease);
|
|
55
|
+
const origin = record(runtimeEpic?.origin_binding);
|
|
56
|
+
if (record(runtime.stories[storyId]) && Object.keys(record(runtime.stories[storyId])).length > 0
|
|
57
|
+
|| !origin || origin.executionBranch !== branch || typeof origin.originHeadSha !== 'string'
|
|
58
|
+
|| !/^[a-f0-9]{40,64}$/.test(origin.originHeadSha)
|
|
59
|
+
|| lease && (!Number.isFinite(Date.parse(String(lease.expiresAt)))
|
|
60
|
+
|| Date.parse(String(lease.expiresAt)) > Date.now()))
|
|
61
|
+
throw new Error('direct-yolo-retry-runtime-active');
|
|
62
|
+
git(root, ['merge-base', '--is-ancestor', String(origin.originHeadSha), head]);
|
|
63
|
+
const privateRoot = await ensureGitLifecyclePrivateChildDirectory(await gitLifecycleRuntimeDirectory(root), 'private-execution');
|
|
64
|
+
const storyHash = digest(storyId);
|
|
65
|
+
for (const name of [`session-${storyHash}.json`, `baseline-${storyHash}.json`]) {
|
|
66
|
+
const path = join(privateRoot, name);
|
|
67
|
+
if (existsSync(path)) {
|
|
68
|
+
await assertGitLifecyclePrivateFile(path, privateRoot);
|
|
69
|
+
throw new Error('direct-yolo-retry-private-evidence-present');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const auditPath = `.neocortex/recovery/${storyId}-c01-${digest(`${head}\0${digest(stateText)}`).slice(0, 16)}.json`;
|
|
73
|
+
if (existsSync(join(root, auditPath)))
|
|
74
|
+
throw new Error('direct-yolo-retry-already-recorded');
|
|
75
|
+
if (git(root, ['rev-parse', 'HEAD']) !== head || readFileSync(join(root, '.neocortex/state.json'), 'utf8') !== stateText) {
|
|
76
|
+
throw new Error('direct-yolo-retry-preflight-raced');
|
|
77
|
+
}
|
|
78
|
+
return Object.freeze({ schemaVersion: 1, kind: 'direct-yolo-c01-retry-plan', storyId, epicId,
|
|
79
|
+
executionBranch: branch, previousHeadSha: head, previousStateSha256: digest(stateText),
|
|
80
|
+
runtimeRevision: runtime.revision,
|
|
81
|
+
previousStatus: 'create-tasks', previousStepsCompleted: [...steps],
|
|
82
|
+
auditPath, publicSafe: true });
|
|
83
|
+
}
|
|
84
|
+
/** Commit a new C01 attempt; the prior progress stays reachable in the parent commit. */
|
|
85
|
+
export async function applyDirectYoloC01Retry(projectRoot, storyId, expectedHeadSha) {
|
|
86
|
+
const root = resolve(projectRoot);
|
|
87
|
+
const lockId = `retry-${randomBytes(16).toString('hex')}`;
|
|
88
|
+
const lock = await acquireGitLifecyclePhysicalIntegrationLock(root, {
|
|
89
|
+
kind: 'direct', storyId, sessionId: lockId, idempotencyKey: lockId,
|
|
90
|
+
expiresAt: new Date(Date.now() + 5 * 60_000).toISOString(), persistent: false,
|
|
91
|
+
});
|
|
92
|
+
if (!lock.ok)
|
|
93
|
+
throw new Error(lock.reasonCode);
|
|
94
|
+
try {
|
|
95
|
+
const plan = await inspectDirectYoloC01Retry(root, storyId);
|
|
96
|
+
if (plan.previousHeadSha !== expectedHeadSha)
|
|
97
|
+
throw new Error('direct-yolo-retry-head-mismatch');
|
|
98
|
+
const statePath = join(root, '.neocortex/state.json');
|
|
99
|
+
const state = JSON.parse(readFileSync(statePath, 'utf8'));
|
|
100
|
+
const story = state.stories[storyId];
|
|
101
|
+
story.status = 'backlog';
|
|
102
|
+
story.steps_completed = [];
|
|
103
|
+
story.last_step = null;
|
|
104
|
+
story.branch_name = null;
|
|
105
|
+
const audit = { ...plan, recordedAt: new Date().toISOString(), reason: 'private-session-lost',
|
|
106
|
+
newAttemptStatus: 'backlog', oldProgressAcceptedForNewAttempt: false };
|
|
107
|
+
story.last_updated = audit.recordedAt;
|
|
108
|
+
const reconfirmed = await inspectDirectYoloC01Retry(root, storyId);
|
|
109
|
+
if (JSON.stringify(reconfirmed) !== JSON.stringify(plan))
|
|
110
|
+
throw new Error('direct-yolo-retry-apply-raced');
|
|
111
|
+
if (git(root, ['rev-parse', 'HEAD']) !== expectedHeadSha
|
|
112
|
+
|| digest(readFileSync(statePath, 'utf8')) !== plan.previousStateSha256
|
|
113
|
+
|| git(root, ['status', '--porcelain=v1', '--untracked-files=all']))
|
|
114
|
+
throw new Error('direct-yolo-retry-apply-raced');
|
|
115
|
+
const { mkdirSync } = await import('node:fs');
|
|
116
|
+
mkdirSync(join(root, '.neocortex/recovery'), { recursive: true });
|
|
117
|
+
writeFileSync(join(root, plan.auditPath), `${JSON.stringify(audit, null, 2)}\n`, { flag: 'wx' });
|
|
118
|
+
writeFileSync(statePath, `${JSON.stringify(state, null, 2)}\n`);
|
|
119
|
+
const runtimeBeforeCommit = await readGitLifecycleRuntime(root, { required: true });
|
|
120
|
+
if (runtimeBeforeCommit.revision !== plan.runtimeRevision)
|
|
121
|
+
throw new Error('direct-yolo-retry-runtime-raced');
|
|
122
|
+
git(root, ['add', '--', '.neocortex/state.json', plan.auditPath]);
|
|
123
|
+
git(root, ['commit', '-m', `chore(${storyId}): begin audited C01 retry`,
|
|
124
|
+
'-m', `Neocortex-C01-Retry-From: ${plan.previousHeadSha}`,
|
|
125
|
+
'-m', `Neocortex-C01-Retry-Audit: ${plan.auditPath}`]);
|
|
126
|
+
const newHeadSha = git(root, ['rev-parse', 'HEAD']);
|
|
127
|
+
const committedPaths = git(root, ['diff-tree', '--no-commit-id', '--name-only', '-r', newHeadSha])
|
|
128
|
+
.split('\n').filter(Boolean).sort();
|
|
129
|
+
if (git(root, ['rev-parse', `${newHeadSha}^`]) !== plan.previousHeadSha
|
|
130
|
+
|| JSON.stringify(committedPaths) !== JSON.stringify(['.neocortex/state.json', plan.auditPath].sort())
|
|
131
|
+
|| git(root, ['status', '--porcelain=v1', '--untracked-files=all']))
|
|
132
|
+
throw new Error('direct-yolo-retry-postcommit-unverified');
|
|
133
|
+
return { plan, newHeadSha };
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
await releaseGitLifecyclePhysicalIntegrationLock(lock.path, lock.owner).catch(() => undefined);
|
|
137
|
+
}
|
|
138
|
+
}
|