@ornexus/neocortex 4.60.73 → 4.60.74
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 +1216 -1210
- package/install.ps1 +1 -1
- package/install.sh +1 -1
- package/package.json +2 -2
- package/packages/client/dist/adapters/adapter-registry.js +1 -108
- package/packages/client/dist/adapters/antigravity-adapter.js +2 -77
- package/packages/client/dist/adapters/claude-code-adapter.js +3 -79
- package/packages/client/dist/adapters/codex-adapter.js +2 -80
- package/packages/client/dist/adapters/cursor-adapter.js +4 -115
- package/packages/client/dist/adapters/gemini-adapter.js +2 -71
- package/packages/client/dist/adapters/grok-adapter.js +2 -42
- package/packages/client/dist/adapters/index.js +1 -22
- package/packages/client/dist/adapters/platform-detector.js +1 -212
- package/packages/client/dist/adapters/target-adapter.js +0 -12
- package/packages/client/dist/adapters/vscode-adapter.js +2 -72
- package/packages/client/dist/agent/refresh-stubs.js +2 -417
- package/packages/client/dist/agent/update-agent-yaml.js +1 -102
- package/packages/client/dist/agent/update-description.js +1 -251
- package/packages/client/dist/cache/crypto-utils.js +1 -78
- package/packages/client/dist/cache/encrypted-cache.js +1 -108
- package/packages/client/dist/cache/in-memory-asset-cache.js +1 -73
- package/packages/client/dist/cache/index.js +1 -13
- package/packages/client/dist/cache/protected-pi-boundary.js +1 -44
- package/packages/client/dist/checkpoint/checkpoint-client-reader.js +2 -127
- package/packages/client/dist/checkpoint/index.js +1 -11
- package/packages/client/dist/checkpoint/shared-checkpoint-types.js +1 -32
- package/packages/client/dist/cli.js +5 -358
- package/packages/client/dist/commands/activate.js +8 -394
- package/packages/client/dist/commands/architecture-answers.js +7 -274
- package/packages/client/dist/commands/architecture-memory-terminal.js +4 -253
- package/packages/client/dist/commands/architecture-non-ui-continuation.js +1 -100
- package/packages/client/dist/commands/architecture-root-binding.js +1 -51
- package/packages/client/dist/commands/cache-status.js +2 -112
- package/packages/client/dist/commands/config.js +1 -88
- package/packages/client/dist/commands/doctor.js +2 -635
- package/packages/client/dist/commands/invoke.js +143 -7200
- package/packages/client/dist/commands/legacy-epic-terminal.js +1 -71
- package/packages/client/dist/commands/legacy-story-branch.js +1 -96
- package/packages/client/dist/commands/legacy-story-pr.js +1 -276
- package/packages/client/dist/commands/mutation-qa-checkpoint.js +5 -285
- package/packages/client/dist/commands/mutation-qa-gate.js +1 -54
- package/packages/client/dist/commands/mutation-qa-git.js +1 -41
- package/packages/client/dist/commands/mutation-qa-policy.js +1 -102
- package/packages/client/dist/commands/mutation-qa-run.js +3 -219
- package/packages/client/dist/commands/mutation-qa-verdict.js +1 -149
- package/packages/client/dist/commands/mutation-qa.js +1 -220
- package/packages/client/dist/commands/native-agent.js +2 -136
- package/packages/client/dist/commands/planning-diagnosis.js +1 -43
- package/packages/client/dist/commands/planning-generation.js +1 -53
- package/packages/client/dist/commands/planning-memory.js +1 -40
- package/packages/client/dist/commands/planning-research.js +1 -42
- package/packages/client/dist/commands/private-session.js +1 -75
- package/packages/client/dist/commands/property-qa.js +1 -139
- package/packages/client/dist/commands/qa-control.js +1 -16
- package/packages/client/dist/commands/qa-scan-browser-launch.js +1 -55
- package/packages/client/dist/commands/qa-scan-browser-route.js +1 -28
- package/packages/client/dist/commands/qa-scan-capture.js +5 -663
- package/packages/client/dist/commands/qa-scan-discovery.js +3 -376
- package/packages/client/dist/commands/qa-scan-review.js +5 -826
- package/packages/client/dist/commands/qa-synthetic-backend-capture.js +1 -266
- package/packages/client/dist/commands/qa-synthetic-backend-review.js +1 -297
- package/packages/client/dist/commands/qa-synthetic-backend.js +2 -340
- package/packages/client/dist/commands/qa-synthetic-broker-port.js +1 -85
- package/packages/client/dist/commands/qa-synthetic-browser.js +1 -39
- package/packages/client/dist/commands/refactor-characterization.js +21 -671
- package/packages/client/dist/commands/refactor-commit.js +13 -399
- package/packages/client/dist/commands/refactor-control.js +3 -142
- package/packages/client/dist/commands/refactor-cpp-assertions.js +3 -93
- package/packages/client/dist/commands/refactor-review.js +5 -283
- package/packages/client/dist/commands/refactor-root.js +7 -588
- package/packages/client/dist/commands/refresh-memory.js +3 -156
- package/packages/client/dist/commands/shared-architecture-non-ui.js +1 -24
- package/packages/client/dist/commands/story-checkpoint.js +1 -171
- package/packages/client/dist/config/profile-directory.js +1 -13
- package/packages/client/dist/config/resolver-selection.js +1 -278
- package/packages/client/dist/config/secure-config.js +12 -281
- package/packages/client/dist/config.js +2 -223
- package/packages/client/dist/constants.js +1 -25
- package/packages/client/dist/context/context-collector.js +2 -222
- package/packages/client/dist/context/context-sanitizer.js +1 -145
- package/packages/client/dist/continuity/autonomous-governance.js +1 -285
- package/packages/client/dist/continuity/continuity-client-state-store.js +1 -1587
- package/packages/client/dist/continuity/invoke-hooks.js +1 -129
- package/packages/client/dist/continuity/migrations/001-initial-schema.js +2 -12
- package/packages/client/dist/continuity/migrations/002-processing-output-summary-indexes.js +2 -12
- package/packages/client/dist/continuity/migrations/003-headless-execution-attempts.js +2 -12
- package/packages/client/dist/continuity/migrations/004-outbox-delivery-state.js +2 -12
- package/packages/client/dist/continuity/migrations/005-bounded-headless-queue.js +2 -12
- package/packages/client/dist/continuity/migrations/006-native-agent-dispatches.js +2 -10
- package/packages/client/dist/continuity/native-agent-store.js +1 -69
- package/packages/client/dist/continuity/native-agent-types.js +1 -90
- package/packages/client/dist/continuity/outbox.js +1 -117
- package/packages/client/dist/continuity/runner-bootstrap-policy.js +1 -172
- package/packages/client/dist/continuity/sqlite-store.js +81 -2612
- package/packages/client/dist/effects/invoke-effect-gateways.js +1 -62
- package/packages/client/dist/errors/error-messages.js +2 -228
- package/packages/client/dist/errors/frontmatter-diagnostics.js +1 -125
- package/packages/client/dist/evidence/collector.js +1 -347
- package/packages/client/dist/evidence/index.js +1 -1
- package/packages/client/dist/evidence/types.js +0 -2
- package/packages/client/dist/fs/atomic-state-replace.js +1 -152
- package/packages/client/dist/generated/command-registry.generated.js +1 -4076
- package/packages/client/dist/generated/public-projections.generated.js +1 -149
- package/packages/client/dist/git/direct-yolo-c01-retry.js +4 -138
- package/packages/client/dist/git/direct-yolo-checkpoint.js +4 -1234
- package/packages/client/dist/git/epic-operational-state.js +2 -672
- package/packages/client/dist/git/git-lifecycle-step-ids.js +1 -14
- package/packages/client/dist/git/git-lifecycle-store.d.ts +23 -0
- package/packages/client/dist/git/git-lifecycle-store.js +10 -1981
- package/packages/client/dist/git/legacy-story-branch-checkpoint.js +9 -259
- package/packages/client/dist/git/legacy-story-branch-setup.js +4 -348
- package/packages/client/dist/git/legacy-story-pr.js +70 -3538
- package/packages/client/dist/git/secure-filesystem-boundary.js +5 -182
- package/packages/client/dist/graph-retrieval/pre-command-hook.js +1 -284
- package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.js +1 -237
- package/packages/client/dist/i18n/first-run.js +2 -60
- package/packages/client/dist/index.js +1 -47
- package/packages/client/dist/invocation/invoke-input.js +1 -24
- package/packages/client/dist/license/index.js +1 -5
- package/packages/client/dist/license/license-client.js +1 -304
- package/packages/client/dist/machine/fingerprint.js +2 -163
- package/packages/client/dist/machine/index.js +1 -5
- package/packages/client/dist/memory/project-memory-path-scope.js +1 -62
- package/packages/client/dist/memory/project-memory-writer.js +40 -1007
- package/packages/client/dist/memory/shared-project-memory-types.js +2 -253
- package/packages/client/dist/migrations/epic-lifecycle-backfill.js +3 -1060
- package/packages/client/dist/migrations/project-identity-capability.js +1 -50
- package/packages/client/dist/migrations/project-identity.js +7 -493
- package/packages/client/dist/migrations/state-json.js +4 -393
- package/packages/client/dist/policy/architecture-policy.js +2 -184
- package/packages/client/dist/policy/index.js +1 -7
- package/packages/client/dist/policy/shared-policy-types.js +0 -38
- package/packages/client/dist/policy/subagent-approval-policy.js +1 -55
- package/packages/client/dist/private-execution/clean-baseline.js +2 -279
- package/packages/client/dist/private-execution/codex-executor.js +4 -574
- package/packages/client/dist/private-execution/codex-host-runtime.js +1 -137
- package/packages/client/dist/private-execution/codex-lifecycle-guard.js +1 -97
- package/packages/client/dist/private-execution/codex-scoped-permissions.js +1 -128
- package/packages/client/dist/private-execution/delivery.js +13 -410
- package/packages/client/dist/private-execution/diagnosis-root-review.js +2 -294
- package/packages/client/dist/private-execution/frozen-handoff.js +6 -19
- package/packages/client/dist/private-execution/implementation-validation.js +2 -106
- package/packages/client/dist/private-execution/isolated-admission.js +23 -1432
- package/packages/client/dist/private-execution/isolated-session.js +5 -725
- package/packages/client/dist/private-execution/isolated-workspace.js +1 -122
- package/packages/client/dist/private-execution/pact-consumer-runtime.js +3 -409
- package/packages/client/dist/private-execution/pact-test-source.js +1 -258
- package/packages/client/dist/private-execution/pact-toolchain.js +3 -290
- package/packages/client/dist/private-execution/pact-write-set.js +1 -172
- package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.js +5 -406
- package/packages/client/dist/private-execution/planning-generation-checkpoint.js +5 -462
- package/packages/client/dist/private-execution/planning-memory-checkpoint.js +3 -139
- package/packages/client/dist/private-execution/planning-research-checkpoint.js +4 -325
- package/packages/client/dist/private-execution/private-report-store.js +1 -42
- package/packages/client/dist/private-execution/property-test-candidate.js +1 -103
- package/packages/client/dist/private-execution/property-test-choices.js +3 -147
- package/packages/client/dist/private-execution/property-test-plan.js +7 -271
- package/packages/client/dist/private-execution/property-test-review.js +4 -258
- package/packages/client/dist/private-execution/property-test-runtime.js +9 -372
- package/packages/client/dist/private-execution/property-test-source.js +1 -139
- package/packages/client/dist/private-execution/root-checkpoint.js +1 -80
- package/packages/client/dist/private-execution/root-memory-git-evidence.js +3 -135
- package/packages/client/dist/private-execution/root-memory-recovery.js +1 -93
- package/packages/client/dist/private-execution/root-memory-request.js +1 -29
- package/packages/client/dist/private-execution/root-memory-scope.js +1 -178
- package/packages/client/dist/private-execution/root-memory-writer.js +1 -102
- package/packages/client/dist/private-execution/session-lease.js +1 -63
- package/packages/client/dist/private-execution/shared-private-admission-types.js +1 -50
- package/packages/client/dist/private-execution/shared-project-validation.js +1 -66
- package/packages/client/dist/private-execution/shared-root-memory-types.js +1 -61
- package/packages/client/dist/private-execution/ux-source-validation.js +1 -372
- package/packages/client/dist/private-execution/ux-write-set.js +2 -191
- package/packages/client/dist/registry/registry-reconciliation.js +1 -234
- package/packages/client/dist/resilience/circuit-breaker.js +1 -170
- package/packages/client/dist/resilience/degradation-manager.js +1 -164
- package/packages/client/dist/resilience/freshness-indicator.js +1 -100
- package/packages/client/dist/resilience/index.js +1 -8
- package/packages/client/dist/resilience/recovery-detector.js +1 -74
- package/packages/client/dist/resolvers/asset-resolver.js +0 -13
- package/packages/client/dist/resolvers/local-resolver.js +8 -255
- package/packages/client/dist/resolvers/remote-resolver.js +1 -233
- package/packages/client/dist/runner/binary.js +1 -404
- package/packages/client/dist/runner/cli.js +17 -1571
- package/packages/client/dist/runner/headless/adapters.js +1 -49
- package/packages/client/dist/runner/headless/claude-code-adapter.js +1 -79
- package/packages/client/dist/runner/headless/continuous-story-workspace.js +11 -1628
- package/packages/client/dist/runner/headless/epic-git-reconciliation-inventory.js +1 -69
- package/packages/client/dist/runner/headless/epic-merge-candidate-qa.d.ts +1 -1
- package/packages/client/dist/runner/headless/epic-merge-candidate-qa.js +2 -110
- package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.d.ts +2 -0
- package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.js +10 -1236
- package/packages/client/dist/runner/headless/epic-terminal-git-runner.d.ts +18 -2
- package/packages/client/dist/runner/headless/epic-terminal-git-runner.js +2 -318
- package/packages/client/dist/runner/headless/fake-adapter.js +1 -62
- package/packages/client/dist/runner/headless/managed-profile.js +1 -132
- package/packages/client/dist/runner/headless/opencode-adapter.js +2 -145
- package/packages/client/dist/runner/headless/prepared-story-bundle.js +1 -43
- package/packages/client/dist/runner/headless/resolver.js +1 -231
- package/packages/client/dist/runner/headless/run-yolo.js +1 -885
- package/packages/client/dist/runner/headless/run-yoloop.d.ts +1 -0
- package/packages/client/dist/runner/headless/run-yoloop.js +2 -2574
- package/packages/client/dist/runner/headless/types.js +2 -574
- package/packages/client/dist/runner/local-console.js +13 -396
- package/packages/client/dist/runner/portal-sync-worker.js +1 -1487
- package/packages/client/dist/runner/project-identity.js +1 -106
- package/packages/client/dist/runner/scheduler.js +7 -995
- package/packages/client/dist/runner-cli.js +2 -18
- package/packages/client/dist/state/invocation-shape.js +1 -13
- package/packages/client/dist/state/project-state-snapshot.js +1 -1731
- package/packages/client/dist/state/state-json-repair.js +3 -785
- package/packages/client/dist/state/structural-dag-projection.js +1 -118
- package/packages/client/dist/telemetry/index.js +1 -5
- package/packages/client/dist/telemetry/offline-queue.js +1 -131
- package/packages/client/dist/tier/index.js +1 -5
- package/packages/client/dist/tier/tier-aware-client.js +1 -405
- package/packages/client/dist/types/index.js +1 -38
- package/packages/client/dist/version.js +1 -27
- package/packages/client/dist/yolo/change-evidence-collector.js +1 -126
- package/packages/client/dist/yolo/invoke-envelope-capability.js +1 -62
- package/packages/client/dist/yolo/spec-envelope-collector.js +5 -184
- package/packages/client/dist/yoloop/discovery-hook.js +2 -300
- package/packages/client/dist/yoloop/index.js +1 -8
- package/packages/client/dist/yoloop/invoke-hooks.js +12 -669
- package/packages/client/dist/yoloop/shared-discover-epics.js +1 -1007
- package/packages/client/dist/yoloop/shared-yoloop-types.js +1 -33
- package/packages/client/dist/yoloop/target-normalization.js +1 -180
- package/packages/client/dist/yoloop/yoloop-client-state-store.js +1 -1920
- package/packages/shared/dist/yolo/change-evidence.js +1 -1
- package/packages/shared/dist/yoloop/epic-terminal-git.js +144 -2
- 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,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
|
-
}
|
|
1
|
+
const e={REQUIRED_DURABLE_COMMAND:"runner-bootstrap-required-durable-command",REQUIRED_UNKNOWN_GOAL_LOOP_OPERATION:"runner-bootstrap-required-unknown-goal-loop-operation",OPTIONAL_OPERATOR_COMMAND:"runner-bootstrap-optional-operator-command",SKIPPED_BOOTSTRAP_IN_PROGRESS:"runner-bootstrap-skipped-bootstrap-in-progress",SKIPPED_RUNNER_PLATFORM:"runner-bootstrap-skipped-runner-platform",SKIPPED_GOAL_LOOP_TICK:"runner-bootstrap-skipped-goal-loop-tick",SKIPPED_JOBS_COMMAND:"runner-bootstrap-skipped-jobs-command",SKIPPED_RUNNER_COMMAND:"runner-bootstrap-skipped-runner-command",SKIPPED_NON_CONTINUITY_COMMAND:"runner-bootstrap-skipped-non-continuity-command"},P=new Set(["goal","goals","durable-goal","continuity-goal","59"]),N=new Set(["loop","loops","durable-loop","continuity-loop","60"]),f=new Set(["jobs","job","continuity-jobs","61"]),R=new Set(["runner","neocortex-runner","continuity-runner","62"]),E=new Map([["goal-tick","goal"],["loop-tick","loop"]]),s=new Set(["create","start","resume","activate","run","run-once","restart","continue","unpause"]),p=new Set(["status","doctor","cancel","pause","report","reports","log","logs"]),S=new Set([...s,...p,"tick"]),A=/^@?(?:goal|loop|job)-[a-z0-9][a-z0-9._-]*$/i;function b(r){const o=T(r),n=l(o[0]);if(!n)return u("unknown","none",!1);const a=E.get(n);if(a)return u(a,"tick",!0);const i=d(n);return i==="unknown"?u("unknown","none",!1):u(i,O(_(o)),!0)}function k(r,o={}){if(C(o))return t(r,e.SKIPPED_BOOTSTRAP_IN_PROGRESS,"runner bootstrap skipped because a bootstrap guard is active.");if(D(o.platformTarget)==="runner")return t(r,e.SKIPPED_RUNNER_PLATFORM,"runner bootstrap skipped for runner platform invocation.");if((r.kind==="goal"||r.kind==="loop")&&r.operation==="tick")return t(r,e.SKIPPED_GOAL_LOOP_TICK,`runner bootstrap skipped for ${r.kind} tick operation.`);if(r.kind==="jobs")return t(r,e.SKIPPED_JOBS_COMMAND,"runner bootstrap skipped for jobs command.");if(r.kind==="runner")return t(r,e.SKIPPED_RUNNER_COMMAND,"runner bootstrap skipped for runner command.");if(r.kind!=="goal"&&r.kind!=="loop")return t(r,e.SKIPPED_NON_CONTINUITY_COMMAND,"runner bootstrap skipped for non-continuity command.");if(p.has(r.operation))return{action:"optional",failurePolicy:"fail-open",command:r.kind,operation:r.operation,reasonCodes:[e.OPTIONAL_OPERATOR_COMMAND],publicSummary:`runner bootstrap optional for ${r.kind} operator command.`,publicSafe:!0};const n=s.has(r.operation)||r.operation==="none"?e.REQUIRED_DURABLE_COMMAND:e.REQUIRED_UNKNOWN_GOAL_LOOP_OPERATION;return{action:"required",failurePolicy:"fail-closed",command:r.kind,operation:r.operation==="none"?"create":r.operation,reasonCodes:[n],publicSummary:`runner bootstrap required for durable ${r.kind} command.`,publicSafe:!0}}function M(r,o={}){return k(b(r),o)}function t(r,o,n){return{action:"skipped",failurePolicy:"not-applicable",command:r.kind,operation:r.operation,reasonCodes:[o],publicSummary:n,publicSafe:!0}}function u(r,o,n){return{kind:r,operation:o,recognizedAlias:n,publicSafe:!0}}function d(r){return P.has(r)?"goal":N.has(r)?"loop":f.has(r)?"jobs":R.has(r)?"runner":"unknown"}function O(r){const o=l(r);return o?S.has(o)?o:"unknown":"none"}function _(r){const o=r[1];if(o)return A.test(o)?r[2]:o}function T(r){return r.trim().split(/\s+/).filter(Boolean).slice(0,3)}function l(r){return(r??"").trim().toLowerCase().replace(/^\*/,"")}function D(r){return(r??"").trim().toLowerCase()}function C(r){return r.bootstrapInProgress?!0:c(r.environment?.NEOCORTEX_RUNNER_BOOTSTRAP_IN_PROGRESS)||c(r.environment?.NEOCORTEX_BOOTSTRAP_IN_PROGRESS)}function c(r){return/^(1|true|yes|on)$/i.test(r??"")}export{e as RUNNER_BOOTSTRAP_POLICY_REASON_CODES,k as classifyRunnerBootstrapPolicy,M as classifyRunnerBootstrapPolicyFromArgs,b as parseRunnerBootstrapCommandIntent};
|