@ornexus/neocortex 4.60.72 → 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 +24 -24
- 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,172 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* P181.03 -- public-safe runner bootstrap classifier for durable goal/loop
|
|
6
|
+
* operations.
|
|
7
|
+
*/
|
|
8
|
+
export const RUNNER_BOOTSTRAP_POLICY_REASON_CODES = {
|
|
9
|
+
REQUIRED_DURABLE_COMMAND: 'runner-bootstrap-required-durable-command',
|
|
10
|
+
REQUIRED_UNKNOWN_GOAL_LOOP_OPERATION: 'runner-bootstrap-required-unknown-goal-loop-operation',
|
|
11
|
+
OPTIONAL_OPERATOR_COMMAND: 'runner-bootstrap-optional-operator-command',
|
|
12
|
+
SKIPPED_BOOTSTRAP_IN_PROGRESS: 'runner-bootstrap-skipped-bootstrap-in-progress',
|
|
13
|
+
SKIPPED_RUNNER_PLATFORM: 'runner-bootstrap-skipped-runner-platform',
|
|
14
|
+
SKIPPED_GOAL_LOOP_TICK: 'runner-bootstrap-skipped-goal-loop-tick',
|
|
15
|
+
SKIPPED_JOBS_COMMAND: 'runner-bootstrap-skipped-jobs-command',
|
|
16
|
+
SKIPPED_RUNNER_COMMAND: 'runner-bootstrap-skipped-runner-command',
|
|
17
|
+
SKIPPED_NON_CONTINUITY_COMMAND: 'runner-bootstrap-skipped-non-continuity-command',
|
|
18
|
+
};
|
|
19
|
+
const GOAL_COMMAND_ALIASES = new Set(['goal', 'goals', 'durable-goal', 'continuity-goal', '59']);
|
|
20
|
+
const LOOP_COMMAND_ALIASES = new Set(['loop', 'loops', 'durable-loop', 'continuity-loop', '60']);
|
|
21
|
+
const JOBS_COMMAND_ALIASES = new Set(['jobs', 'job', 'continuity-jobs', '61']);
|
|
22
|
+
const RUNNER_COMMAND_ALIASES = new Set(['runner', 'neocortex-runner', 'continuity-runner', '62']);
|
|
23
|
+
const GOAL_LOOP_TICK_ALIASES = new Map([
|
|
24
|
+
['goal-tick', 'goal'],
|
|
25
|
+
['loop-tick', 'loop'],
|
|
26
|
+
]);
|
|
27
|
+
const REQUIRED_OPERATIONS = new Set([
|
|
28
|
+
'create',
|
|
29
|
+
'start',
|
|
30
|
+
'resume',
|
|
31
|
+
'activate',
|
|
32
|
+
'run',
|
|
33
|
+
'run-once',
|
|
34
|
+
'restart',
|
|
35
|
+
'continue',
|
|
36
|
+
'unpause',
|
|
37
|
+
]);
|
|
38
|
+
const OPTIONAL_OPERATIONS = new Set([
|
|
39
|
+
'status',
|
|
40
|
+
'doctor',
|
|
41
|
+
'cancel',
|
|
42
|
+
'pause',
|
|
43
|
+
'report',
|
|
44
|
+
'reports',
|
|
45
|
+
'log',
|
|
46
|
+
'logs',
|
|
47
|
+
]);
|
|
48
|
+
const KNOWN_OPERATIONS = new Set([
|
|
49
|
+
...REQUIRED_OPERATIONS,
|
|
50
|
+
...OPTIONAL_OPERATIONS,
|
|
51
|
+
'tick',
|
|
52
|
+
]);
|
|
53
|
+
const PUBLIC_TARGET_TOKEN_RE = /^@?(?:goal|loop|job)-[a-z0-9][a-z0-9._-]*$/i;
|
|
54
|
+
export function parseRunnerBootstrapCommandIntent(args) {
|
|
55
|
+
const tokens = publicCommandTokens(args);
|
|
56
|
+
const first = normalizeToken(tokens[0]);
|
|
57
|
+
if (!first)
|
|
58
|
+
return intent('unknown', 'none', false);
|
|
59
|
+
const tickAliasKind = GOAL_LOOP_TICK_ALIASES.get(first);
|
|
60
|
+
if (tickAliasKind)
|
|
61
|
+
return intent(tickAliasKind, 'tick', true);
|
|
62
|
+
const kind = commandKindForToken(first);
|
|
63
|
+
if (kind === 'unknown')
|
|
64
|
+
return intent('unknown', 'none', false);
|
|
65
|
+
if (kind === 'jobs' || kind === 'runner') {
|
|
66
|
+
return intent(kind, operationForToken(publicOperationToken(tokens)), true);
|
|
67
|
+
}
|
|
68
|
+
return intent(kind, operationForToken(publicOperationToken(tokens)), true);
|
|
69
|
+
}
|
|
70
|
+
export function classifyRunnerBootstrapPolicy(commandIntent, context = {}) {
|
|
71
|
+
if (isBootstrapInProgress(context)) {
|
|
72
|
+
return skipped(commandIntent, RUNNER_BOOTSTRAP_POLICY_REASON_CODES.SKIPPED_BOOTSTRAP_IN_PROGRESS, 'runner bootstrap skipped because a bootstrap guard is active.');
|
|
73
|
+
}
|
|
74
|
+
if (normalizePlatformTarget(context.platformTarget) === 'runner') {
|
|
75
|
+
return skipped(commandIntent, RUNNER_BOOTSTRAP_POLICY_REASON_CODES.SKIPPED_RUNNER_PLATFORM, 'runner bootstrap skipped for runner platform invocation.');
|
|
76
|
+
}
|
|
77
|
+
if ((commandIntent.kind === 'goal' || commandIntent.kind === 'loop') && commandIntent.operation === 'tick') {
|
|
78
|
+
return skipped(commandIntent, RUNNER_BOOTSTRAP_POLICY_REASON_CODES.SKIPPED_GOAL_LOOP_TICK, `runner bootstrap skipped for ${commandIntent.kind} tick operation.`);
|
|
79
|
+
}
|
|
80
|
+
if (commandIntent.kind === 'jobs') {
|
|
81
|
+
return skipped(commandIntent, RUNNER_BOOTSTRAP_POLICY_REASON_CODES.SKIPPED_JOBS_COMMAND, 'runner bootstrap skipped for jobs command.');
|
|
82
|
+
}
|
|
83
|
+
if (commandIntent.kind === 'runner') {
|
|
84
|
+
return skipped(commandIntent, RUNNER_BOOTSTRAP_POLICY_REASON_CODES.SKIPPED_RUNNER_COMMAND, 'runner bootstrap skipped for runner command.');
|
|
85
|
+
}
|
|
86
|
+
if (commandIntent.kind !== 'goal' && commandIntent.kind !== 'loop') {
|
|
87
|
+
return skipped(commandIntent, RUNNER_BOOTSTRAP_POLICY_REASON_CODES.SKIPPED_NON_CONTINUITY_COMMAND, 'runner bootstrap skipped for non-continuity command.');
|
|
88
|
+
}
|
|
89
|
+
if (OPTIONAL_OPERATIONS.has(commandIntent.operation)) {
|
|
90
|
+
return {
|
|
91
|
+
action: 'optional',
|
|
92
|
+
failurePolicy: 'fail-open',
|
|
93
|
+
command: commandIntent.kind,
|
|
94
|
+
operation: commandIntent.operation,
|
|
95
|
+
reasonCodes: [RUNNER_BOOTSTRAP_POLICY_REASON_CODES.OPTIONAL_OPERATOR_COMMAND],
|
|
96
|
+
publicSummary: `runner bootstrap optional for ${commandIntent.kind} operator command.`,
|
|
97
|
+
publicSafe: true,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const reasonCode = REQUIRED_OPERATIONS.has(commandIntent.operation) || commandIntent.operation === 'none'
|
|
101
|
+
? RUNNER_BOOTSTRAP_POLICY_REASON_CODES.REQUIRED_DURABLE_COMMAND
|
|
102
|
+
: RUNNER_BOOTSTRAP_POLICY_REASON_CODES.REQUIRED_UNKNOWN_GOAL_LOOP_OPERATION;
|
|
103
|
+
return {
|
|
104
|
+
action: 'required',
|
|
105
|
+
failurePolicy: 'fail-closed',
|
|
106
|
+
command: commandIntent.kind,
|
|
107
|
+
operation: commandIntent.operation === 'none' ? 'create' : commandIntent.operation,
|
|
108
|
+
reasonCodes: [reasonCode],
|
|
109
|
+
publicSummary: `runner bootstrap required for durable ${commandIntent.kind} command.`,
|
|
110
|
+
publicSafe: true,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export function classifyRunnerBootstrapPolicyFromArgs(args, context = {}) {
|
|
114
|
+
return classifyRunnerBootstrapPolicy(parseRunnerBootstrapCommandIntent(args), context);
|
|
115
|
+
}
|
|
116
|
+
function skipped(commandIntent, reasonCode, publicSummary) {
|
|
117
|
+
return {
|
|
118
|
+
action: 'skipped',
|
|
119
|
+
failurePolicy: 'not-applicable',
|
|
120
|
+
command: commandIntent.kind,
|
|
121
|
+
operation: commandIntent.operation,
|
|
122
|
+
reasonCodes: [reasonCode],
|
|
123
|
+
publicSummary,
|
|
124
|
+
publicSafe: true,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function intent(kind, operation, recognizedAlias) {
|
|
128
|
+
return { kind, operation, recognizedAlias, publicSafe: true };
|
|
129
|
+
}
|
|
130
|
+
function commandKindForToken(token) {
|
|
131
|
+
if (GOAL_COMMAND_ALIASES.has(token))
|
|
132
|
+
return 'goal';
|
|
133
|
+
if (LOOP_COMMAND_ALIASES.has(token))
|
|
134
|
+
return 'loop';
|
|
135
|
+
if (JOBS_COMMAND_ALIASES.has(token))
|
|
136
|
+
return 'jobs';
|
|
137
|
+
if (RUNNER_COMMAND_ALIASES.has(token))
|
|
138
|
+
return 'runner';
|
|
139
|
+
return 'unknown';
|
|
140
|
+
}
|
|
141
|
+
function operationForToken(token) {
|
|
142
|
+
const normalized = normalizeToken(token);
|
|
143
|
+
if (!normalized)
|
|
144
|
+
return 'none';
|
|
145
|
+
return KNOWN_OPERATIONS.has(normalized) ? normalized : 'unknown';
|
|
146
|
+
}
|
|
147
|
+
function publicOperationToken(tokens) {
|
|
148
|
+
const second = tokens[1];
|
|
149
|
+
if (!second)
|
|
150
|
+
return undefined;
|
|
151
|
+
if (PUBLIC_TARGET_TOKEN_RE.test(second))
|
|
152
|
+
return tokens[2];
|
|
153
|
+
return second;
|
|
154
|
+
}
|
|
155
|
+
function publicCommandTokens(args) {
|
|
156
|
+
return args.trim().split(/\s+/).filter(Boolean).slice(0, 3);
|
|
157
|
+
}
|
|
158
|
+
function normalizeToken(token) {
|
|
159
|
+
return (token ?? '').trim().toLowerCase().replace(/^\*/, '');
|
|
160
|
+
}
|
|
161
|
+
function normalizePlatformTarget(platformTarget) {
|
|
162
|
+
return (platformTarget ?? '').trim().toLowerCase();
|
|
163
|
+
}
|
|
164
|
+
function isBootstrapInProgress(context) {
|
|
165
|
+
if (context.bootstrapInProgress)
|
|
166
|
+
return true;
|
|
167
|
+
return truthyGuard(context.environment?.NEOCORTEX_RUNNER_BOOTSTRAP_IN_PROGRESS)
|
|
168
|
+
|| truthyGuard(context.environment?.NEOCORTEX_BOOTSTRAP_IN_PROGRESS);
|
|
169
|
+
}
|
|
170
|
+
function truthyGuard(value) {
|
|
171
|
+
return /^(1|true|yes|on)$/i.test(value ?? '');
|
|
172
|
+
}
|
|
@@ -46,7 +46,7 @@ export declare function sanitizeContinuityStageTimestamp(value: unknown): string
|
|
|
46
46
|
*/
|
|
47
47
|
export declare function sanitizeContinuityStageHistory(value: unknown): ContinuityStageHistoryEntry[];
|
|
48
48
|
export declare function normalizeContinuityStageIteration(value: unknown): number | undefined;
|
|
49
|
-
export type ContinuitySqliteStoreErrorCode = 'sqlite-adapter-unavailable' | 'sqlite-integrity-failed' | 'sqlite-migration-failed' | 'sqlite-migration-conflict' | 'sqlite-mutation-failed' | 'sqlite-foreign-key-failed' | 'sqlite-public-safety-rejected' | 'sqlite-mutation-blocked';
|
|
49
|
+
export type ContinuitySqliteStoreErrorCode = 'sqlite-adapter-unavailable' | 'sqlite-projection-missing' | 'sqlite-projection-wal-unsafe' | 'sqlite-projection-adapter-incompatible' | 'sqlite-projection-schema-unsupported' | 'sqlite-integrity-failed' | 'sqlite-migration-failed' | 'sqlite-migration-conflict' | 'sqlite-mutation-failed' | 'sqlite-foreign-key-failed' | 'sqlite-public-safety-rejected' | 'sqlite-mutation-blocked';
|
|
50
50
|
export declare class ContinuitySqliteStoreError extends Error {
|
|
51
51
|
readonly code: ContinuitySqliteStoreErrorCode;
|
|
52
52
|
readonly reasonCode: ContinuitySqliteStoreErrorCode;
|
|
@@ -119,6 +119,15 @@ export interface ContinuitySqliteReadOnlyInspector {
|
|
|
119
119
|
get(source: string, ...params: readonly unknown[]): unknown;
|
|
120
120
|
close(): void;
|
|
121
121
|
}
|
|
122
|
+
export interface EpicOperationalSqliteBindingInspectionV1 {
|
|
123
|
+
readonly schemaVersion: 'EpicOperationalSqliteBindingInspection/1.0';
|
|
124
|
+
readonly status: 'bound' | 'unbound' | 'unavailable';
|
|
125
|
+
readonly authorityRevision: number;
|
|
126
|
+
readonly sourceDigest: string | null;
|
|
127
|
+
readonly adapterName: string | null;
|
|
128
|
+
readonly reasonCodes: readonly string[];
|
|
129
|
+
readonly publicSafe: true;
|
|
130
|
+
}
|
|
122
131
|
export interface ContinuityJobWriteInput {
|
|
123
132
|
readonly jobId: string;
|
|
124
133
|
readonly kind: 'goal' | 'loop' | 'runner' | 'jobs';
|
|
@@ -883,6 +892,18 @@ export declare function openContinuitySqliteStore(options: OpenContinuitySqliteS
|
|
|
883
892
|
* chmod, initialization, migrations or mutative pragma is attempted.
|
|
884
893
|
*/
|
|
885
894
|
export declare function openContinuitySqliteReadOnly(options: OpenContinuitySqliteReadOnlyOptions): Promise<ContinuitySqliteReadOnlyInspector>;
|
|
895
|
+
/**
|
|
896
|
+
* P224.01 strict projection binding. The existing state_snapshots table is
|
|
897
|
+
* inspected without schema initialization, WAL, chmod, mkdir or repair. A
|
|
898
|
+
* missing/optional adapter is explicit and never promoted to equality.
|
|
899
|
+
*/
|
|
900
|
+
export declare function inspectEpicOperationalSqliteBinding(options: {
|
|
901
|
+
readonly projectRoot: string;
|
|
902
|
+
readonly authorityRevision: number;
|
|
903
|
+
readonly sourceDigest: string;
|
|
904
|
+
readonly adapter?: ContinuitySqliteAdapter;
|
|
905
|
+
readonly adapterLoader?: () => Promise<ContinuitySqliteAdapterLoadResult>;
|
|
906
|
+
}): Promise<EpicOperationalSqliteBindingInspectionV1>;
|
|
886
907
|
export declare class ContinuitySqliteStore {
|
|
887
908
|
readonly filePath: string;
|
|
888
909
|
readonly adapterName: string;
|