@cleocode/core 2026.9.24 → 2026.9.25
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/audit-prune.d.ts +32 -0
- package/dist/audit-prune.d.ts.map +1 -1
- package/dist/audit-prune.js +37 -3
- package/dist/audit-prune.js.map +1 -1
- package/dist/build-provenance.json +2 -2
- package/dist/cloud/crypto.d.ts +1 -2
- package/dist/cloud/crypto.d.ts.map +1 -1
- package/dist/cloud/crypto.js +1 -11
- package/dist/cloud/crypto.js.map +1 -1
- package/dist/cloud/uuidv7.d.ts +9 -0
- package/dist/cloud/uuidv7.d.ts.map +1 -0
- package/dist/cloud/uuidv7.js +19 -0
- package/dist/cloud/uuidv7.js.map +1 -0
- package/dist/decide/bench/index.d.ts +1 -1
- package/dist/decide/bench/index.d.ts.map +1 -1
- package/dist/decide/bench/index.js +1 -1
- package/dist/decide/bench/index.js.map +1 -1
- package/dist/decide/bench/operation.d.ts +1 -1
- package/dist/decide/bench/operation.d.ts.map +1 -1
- package/dist/decide/bench/operation.js +1 -1
- package/dist/decide/bench/operation.js.map +1 -1
- package/dist/decide/bench/profiles.d.ts +50 -22
- package/dist/decide/bench/profiles.d.ts.map +1 -1
- package/dist/decide/bench/profiles.js +103 -59
- package/dist/decide/bench/profiles.js.map +1 -1
- package/dist/decide/bench/report.d.ts.map +1 -1
- package/dist/decide/bench/report.js +6 -1
- package/dist/decide/bench/report.js.map +1 -1
- package/dist/decide/bench/runner.d.ts +6 -1
- package/dist/decide/bench/runner.d.ts.map +1 -1
- package/dist/decide/bench/runner.js +1 -0
- package/dist/decide/bench/runner.js.map +1 -1
- package/dist/decide/client.d.ts.map +1 -1
- package/dist/decide/client.js +11 -5
- package/dist/decide/client.js.map +1 -1
- package/dist/decide/jev-wire.d.ts +31 -1
- package/dist/decide/jev-wire.d.ts.map +1 -1
- package/dist/decide/jev-wire.js +61 -7
- package/dist/decide/jev-wire.js.map +1 -1
- package/dist/docs/export-document.js +17181 -15536
- package/dist/docs/export-document.js.map +3 -3
- package/dist/doctor/orphan-ac-bindings.d.ts +64 -0
- package/dist/doctor/orphan-ac-bindings.d.ts.map +1 -0
- package/dist/doctor/orphan-ac-bindings.js +59 -0
- package/dist/doctor/orphan-ac-bindings.js.map +1 -0
- package/dist/doctor/projects.d.ts.map +1 -1
- package/dist/doctor/projects.js +43 -29
- package/dist/doctor/projects.js.map +1 -1
- package/dist/doctor/row-identity.d.ts +31 -0
- package/dist/doctor/row-identity.d.ts.map +1 -0
- package/dist/doctor/row-identity.js +93 -0
- package/dist/doctor/row-identity.js.map +1 -0
- package/dist/doctor/twin-collapse.d.ts +58 -2
- package/dist/doctor/twin-collapse.d.ts.map +1 -1
- package/dist/doctor/twin-collapse.js +212 -14
- package/dist/doctor/twin-collapse.js.map +1 -1
- package/dist/lifecycle/verification/satisfies-validator.d.ts.map +1 -1
- package/dist/lifecycle/verification/satisfies-validator.js +10 -0
- package/dist/lifecycle/verification/satisfies-validator.js.map +1 -1
- package/dist/llm/plugin-facade.js +17045 -15400
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +19 -10
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/manifest-identity.d.ts +171 -0
- package/dist/memory/manifest-identity.d.ts.map +1 -0
- package/dist/memory/manifest-identity.js +345 -0
- package/dist/memory/manifest-identity.js.map +1 -0
- package/dist/memory/mental-model-queue.d.ts +14 -4
- package/dist/memory/mental-model-queue.d.ts.map +1 -1
- package/dist/memory/mental-model-queue.js +64 -35
- package/dist/memory/mental-model-queue.js.map +1 -1
- package/dist/memory/pipeline-manifest-sqlite.d.ts +47 -5
- package/dist/memory/pipeline-manifest-sqlite.d.ts.map +1 -1
- package/dist/memory/pipeline-manifest-sqlite.js +130 -14
- package/dist/memory/pipeline-manifest-sqlite.js.map +1 -1
- package/dist/memory/retrieval/observe.d.ts.map +1 -1
- package/dist/memory/retrieval/observe.js +2 -0
- package/dist/memory/retrieval/observe.js.map +1 -1
- package/dist/memory/transcript-scanner.js +1 -1
- package/dist/nexus/deps.d.ts.map +1 -1
- package/dist/nexus/deps.js +7 -14
- package/dist/nexus/deps.js.map +1 -1
- package/dist/nexus/discover.d.ts.map +1 -1
- package/dist/nexus/discover.js +6 -9
- package/dist/nexus/discover.js.map +1 -1
- package/dist/nexus/git-state.d.ts.map +1 -1
- package/dist/nexus/git-state.js +10 -1
- package/dist/nexus/git-state.js.map +1 -1
- package/dist/nexus/projects-clean.d.ts.map +1 -1
- package/dist/nexus/projects-clean.js +22 -11
- package/dist/nexus/projects-clean.js.map +1 -1
- package/dist/nexus/projects-scan.d.ts.map +1 -1
- package/dist/nexus/projects-scan.js +8 -13
- package/dist/nexus/projects-scan.js.map +1 -1
- package/dist/nexus/query.d.ts.map +1 -1
- package/dist/nexus/query.js +4 -12
- package/dist/nexus/query.js.map +1 -1
- package/dist/nexus/registry-roots.d.ts +5 -2
- package/dist/nexus/registry-roots.d.ts.map +1 -1
- package/dist/nexus/registry-roots.js +8 -10
- package/dist/nexus/registry-roots.js.map +1 -1
- package/dist/nexus/registry.d.ts +18 -0
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +37 -16
- package/dist/nexus/registry.js.map +1 -1
- package/dist/orchestrate/worktree-complete.d.ts.map +1 -1
- package/dist/orchestrate/worktree-complete.js +40 -2
- package/dist/orchestrate/worktree-complete.js.map +1 -1
- package/dist/orchestration/spawn-prompt.d.ts +26 -0
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +62 -91
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/release/ci-evidence.d.ts +190 -0
- package/dist/release/ci-evidence.d.ts.map +1 -1
- package/dist/release/ci-evidence.js +436 -4
- package/dist/release/ci-evidence.js.map +1 -1
- package/dist/sdk/validator-ac-pull.d.ts.map +1 -1
- package/dist/sdk/validator-ac-pull.js +2 -1
- package/dist/sdk/validator-ac-pull.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +17049 -15404
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sentient/cross-project-hygiene.d.ts +5 -0
- package/dist/sentient/cross-project-hygiene.d.ts.map +1 -1
- package/dist/sentient/cross-project-hygiene.js +7 -1
- package/dist/sentient/cross-project-hygiene.js.map +1 -1
- package/dist/sentient/propose-tick.d.ts.map +1 -1
- package/dist/sentient/propose-tick.js +2 -3
- package/dist/sentient/propose-tick.js.map +1 -1
- package/dist/sentient/stage-drift-tick.d.ts.map +1 -1
- package/dist/sentient/stage-drift-tick.js +2 -3
- package/dist/sentient/stage-drift-tick.js.map +1 -1
- package/dist/skills/manifests/research.js +2 -0
- package/dist/skills/manifests/research.js.map +1 -1
- package/dist/skills/orchestrator/validator.d.ts.map +1 -1
- package/dist/skills/orchestrator/validator.js +9 -2
- package/dist/skills/orchestrator/validator.js.map +1 -1
- package/dist/skills/validation.d.ts +4 -1
- package/dist/skills/validation.d.ts.map +1 -1
- package/dist/skills/validation.js +11 -3
- package/dist/skills/validation.js.map +1 -1
- package/dist/spawn/branch-lock.d.ts +111 -7
- package/dist/spawn/branch-lock.d.ts.map +1 -1
- package/dist/spawn/branch-lock.js +296 -8
- package/dist/spawn/branch-lock.js.map +1 -1
- package/dist/store/ac-binding-prune.d.ts +144 -0
- package/dist/store/ac-binding-prune.d.ts.map +1 -0
- package/dist/store/ac-binding-prune.js +293 -0
- package/dist/store/ac-binding-prune.js.map +1 -0
- package/dist/store/agent-registry-store.d.ts.map +1 -1
- package/dist/store/agent-registry-store.js +3 -2
- package/dist/store/agent-registry-store.js.map +1 -1
- package/dist/store/backup-sidecar.d.ts +85 -2
- package/dist/store/backup-sidecar.d.ts.map +1 -1
- package/dist/store/backup-sidecar.js +173 -1
- package/dist/store/backup-sidecar.js.map +1 -1
- package/dist/store/conduit-sqlite.d.ts.map +1 -1
- package/dist/store/conduit-sqlite.js +3 -2
- package/dist/store/conduit-sqlite.js.map +1 -1
- package/dist/store/credential-transfer.d.ts.map +1 -1
- package/dist/store/credential-transfer.js +3 -0
- package/dist/store/credential-transfer.js.map +1 -1
- package/dist/store/db-helpers.d.ts +17 -11
- package/dist/store/db-helpers.d.ts.map +1 -1
- package/dist/store/db-helpers.js +61 -38
- package/dist/store/db-helpers.js.map +1 -1
- package/dist/store/display-id-alias.d.ts +529 -0
- package/dist/store/display-id-alias.d.ts.map +1 -0
- package/dist/store/display-id-alias.js +1063 -0
- package/dist/store/display-id-alias.js.map +1 -0
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +21 -0
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/reconcile.d.ts.map +1 -1
- package/dist/store/exodus/reconcile.js +7 -2
- package/dist/store/exodus/reconcile.js.map +1 -1
- package/dist/store/exodus/recovery.d.ts.map +1 -1
- package/dist/store/exodus/recovery.js +20 -1
- package/dist/store/exodus/recovery.js.map +1 -1
- package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
- package/dist/store/legacy-tasks-lineage.js +19 -2
- package/dist/store/legacy-tasks-lineage.js.map +1 -1
- package/dist/store/row-identity-flag.d.ts +26 -0
- package/dist/store/row-identity-flag.d.ts.map +1 -0
- package/dist/store/row-identity-flag.js +31 -0
- package/dist/store/row-identity-flag.js.map +1 -0
- package/dist/store/row-identity-registry.d.ts +61 -0
- package/dist/store/row-identity-registry.d.ts.map +1 -0
- package/dist/store/row-identity-registry.js +198 -0
- package/dist/store/row-identity-registry.js.map +1 -0
- package/dist/store/row-identity.d.ts +390 -0
- package/dist/store/row-identity.d.ts.map +1 -0
- package/dist/store/row-identity.js +1240 -0
- package/dist/store/row-identity.js.map +1 -0
- package/dist/store/safety-data-accessor.d.ts +2 -0
- package/dist/store/safety-data-accessor.d.ts.map +1 -1
- package/dist/store/safety-data-accessor.js +4 -0
- package/dist/store/safety-data-accessor.js.map +1 -1
- package/dist/store/schema/attachments.d.ts +1 -1
- package/dist/store/schema/audit.d.ts +4 -4
- package/dist/store/schema/background-jobs.d.ts +1 -1
- package/dist/store/schema/cleo-global/nexus.d.ts +1 -1
- package/dist/store/schema/cleo-global/skills.d.ts +2 -2
- package/dist/store/schema/cleo-project/audit.d.ts +4 -4
- package/dist/store/schema/cleo-project/docs.d.ts +1 -1
- package/dist/store/schema/cleo-project/lifecycle.d.ts +4 -4
- package/dist/store/schema/cleo-project/nexus-graph.d.ts +3 -3
- package/dist/store/schema/cleo-project/provenance-commits.d.ts +2 -2
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +3 -3
- package/dist/store/schema/cleo-project/runtime.d.ts +3 -3
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +87 -1
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/tasks-core-batch2.js +35 -0
- package/dist/store/schema/cleo-project/tasks-core-batch2.js.map +1 -1
- package/dist/store/schema/cleo-project/tasks-core.d.ts +183 -7
- package/dist/store/schema/cleo-project/tasks-core.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/tasks-core.js +52 -1
- package/dist/store/schema/cleo-project/tasks-core.js.map +1 -1
- package/dist/store/schema/cleo-shared/brain.d.ts +6 -6
- package/dist/store/schema/lifecycle.d.ts +4 -4
- package/dist/store/schema/manifest.d.ts +1 -1
- package/dist/store/schema/memory-schema.d.ts +5 -5
- package/dist/store/schema/nexus-schema.d.ts +3 -3
- package/dist/store/schema/provenance/releases.d.ts +1 -1
- package/dist/store/schema/skills-schema.d.ts +2 -2
- package/dist/store/schema/tasks.d.ts +6 -6
- package/dist/store/split-brain-import.d.ts +2 -14
- package/dist/store/split-brain-import.d.ts.map +1 -1
- package/dist/store/split-brain-import.js +4 -19
- package/dist/store/split-brain-import.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts +279 -2
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +544 -44
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sync/clock-store.d.ts +67 -0
- package/dist/store/sync/clock-store.d.ts.map +1 -0
- package/dist/store/sync/clock-store.js +117 -0
- package/dist/store/sync/clock-store.js.map +1 -0
- package/dist/store/sync/flags.d.ts +51 -0
- package/dist/store/sync/flags.d.ts.map +1 -0
- package/dist/store/sync/flags.js +81 -0
- package/dist/store/sync/flags.js.map +1 -0
- package/dist/store/sync/hlc.d.ts +115 -0
- package/dist/store/sync/hlc.d.ts.map +1 -0
- package/dist/store/sync/hlc.js +172 -0
- package/dist/store/sync/hlc.js.map +1 -0
- package/dist/store/sync/index.d.ts +20 -0
- package/dist/store/sync/index.d.ts.map +1 -0
- package/dist/store/sync/index.js +20 -0
- package/dist/store/sync/index.js.map +1 -0
- package/dist/store/sync/replica-registry.d.ts +85 -0
- package/dist/store/sync/replica-registry.d.ts.map +1 -0
- package/dist/store/sync/replica-registry.js +147 -0
- package/dist/store/sync/replica-registry.js.map +1 -0
- package/dist/store/sync/replica.d.ts +181 -0
- package/dist/store/sync/replica.d.ts.map +1 -0
- package/dist/store/sync/replica.js +305 -0
- package/dist/store/sync/replica.js.map +1 -0
- package/dist/store/sync/schema.d.ts +68 -0
- package/dist/store/sync/schema.d.ts.map +1 -0
- package/dist/store/sync/schema.js +130 -0
- package/dist/store/sync/schema.js.map +1 -0
- package/dist/store/sync/skew-hold.d.ts +71 -0
- package/dist/store/sync/skew-hold.d.ts.map +1 -0
- package/dist/store/sync/skew-hold.js +89 -0
- package/dist/store/sync/skew-hold.js.map +1 -0
- package/dist/store/table-classification.d.ts +10 -8
- package/dist/store/table-classification.d.ts.map +1 -1
- package/dist/store/table-classification.js +93 -25
- package/dist/store/table-classification.js.map +1 -1
- package/dist/store/tasks-sqlite.d.ts.map +1 -1
- package/dist/store/tasks-sqlite.js +9 -1
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/store/twin-collapse.d.ts +113 -2
- package/dist/store/twin-collapse.d.ts.map +1 -1
- package/dist/store/twin-collapse.js +247 -19
- package/dist/store/twin-collapse.js.map +1 -1
- package/dist/store/umbrella-data-accessor.d.ts +2 -0
- package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
- package/dist/store/umbrella-data-accessor.js +4 -0
- package/dist/store/umbrella-data-accessor.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +241 -49
- package/dist/store/validation-schemas.d.ts.map +1 -1
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +3 -0
- package/dist/system/health.js.map +1 -1
- package/dist/system/project-health.d.ts +9 -2
- package/dist/system/project-health.d.ts.map +1 -1
- package/dist/system/project-health.js +8 -3
- package/dist/system/project-health.js.map +1 -1
- package/dist/tasks/ac-coverage-gate.d.ts.map +1 -1
- package/dist/tasks/ac-coverage-gate.js +3 -0
- package/dist/tasks/ac-coverage-gate.js.map +1 -1
- package/dist/tasks/ac-table.d.ts +35 -7
- package/dist/tasks/ac-table.d.ts.map +1 -1
- package/dist/tasks/ac-table.js +119 -14
- package/dist/tasks/ac-table.js.map +1 -1
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +48 -2
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/backfill-child-projections.js +47 -6
- package/dist/tasks/backfill-child-projections.js.map +1 -1
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +6 -1
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/completion-evaluation.d.ts.map +1 -1
- package/dist/tasks/completion-evaluation.js +3 -0
- package/dist/tasks/completion-evaluation.js.map +1 -1
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +14 -3
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/validation/compliance.d.ts +5 -1
- package/dist/validation/compliance.d.ts.map +1 -1
- package/dist/validation/compliance.js +24 -3
- package/dist/validation/compliance.js.map +1 -1
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/protocol-common.d.ts +47 -2
- package/dist/validation/protocol-common.d.ts.map +1 -1
- package/dist/validation/protocol-common.js +86 -21
- package/dist/validation/protocol-common.js.map +1 -1
- package/migrations/README.md +12 -0
- package/migrations/drizzle-cleo-project/20260928120000_t12341-row-uids/migration.sql +169 -0
- package/migrations/sync-journal/20260929140000_t12342-sync-clock/migration.sql +42 -0
- package/package.json +13 -13
- package/templates/CLEO-REFERENCE.md +4 -0
|
@@ -56,11 +56,20 @@ const VALID_TYPES = [
|
|
|
56
56
|
'Testing',
|
|
57
57
|
'Specification',
|
|
58
58
|
'Consensus',
|
|
59
|
+
'ADR',
|
|
59
60
|
'Decomposition',
|
|
60
61
|
'Contribution',
|
|
61
62
|
'Release',
|
|
62
63
|
];
|
|
63
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Statuses a return message may carry. `complete` is the spelling the spawn
|
|
66
|
+
* prompt renders; `completed` is the manifest status and stays accepted.
|
|
67
|
+
*/
|
|
68
|
+
const RETURN_STATUSES = ['complete', ...MANIFEST_STATUSES.filter((s) => s !== 'archived')];
|
|
69
|
+
/** Tail of the legacy one-line return message (ADR-027). */
|
|
70
|
+
const LEGACY_RETURN_TAIL = ' Manifest appended to pipeline_manifest.';
|
|
71
|
+
/** Keys a compressed return message may carry after its first line (T12521). */
|
|
72
|
+
const RETURN_DETAIL_KEYS = ['commits', 'gates', 'blocker'];
|
|
64
73
|
/**
|
|
65
74
|
* Map from protocol type identifiers to the expected message type prefix.
|
|
66
75
|
* When a protocolType is provided, the return message must use the matching type.
|
|
@@ -72,38 +81,94 @@ const PROTOCOL_TYPE_MAP = {
|
|
|
72
81
|
testing: 'Testing',
|
|
73
82
|
specification: 'Specification',
|
|
74
83
|
consensus: 'Consensus',
|
|
84
|
+
architecture_decision: 'ADR',
|
|
75
85
|
decomposition: 'Decomposition',
|
|
76
86
|
contribution: 'Contribution',
|
|
77
87
|
release: 'Release',
|
|
78
88
|
};
|
|
79
89
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
90
|
+
* Parse a subagent return message in the compressed or the legacy form.
|
|
91
|
+
*
|
|
92
|
+
* One surrounding ``` fence is stripped first. In the compressed form:
|
|
93
|
+
* `blocker` must be `none` (or absent) when the status is
|
|
94
|
+
* `complete`/`completed`, and present and not `none` when it is
|
|
95
|
+
* `partial`/`blocked`; `manifest:none` is accepted only for `partial`/`blocked`;
|
|
96
|
+
* an entry id containing `<` or `>` (an unfilled `<entryId>` placeholder) is
|
|
97
|
+
* rejected. Unknown, duplicate or empty detail lines reject the message, and a
|
|
98
|
+
* legacy message must be exactly one line (its rules are unchanged).
|
|
99
|
+
*
|
|
100
|
+
* @param message - Raw return message (surrounding whitespace and one
|
|
101
|
+
* surrounding code fence are ignored).
|
|
102
|
+
* @param types - Allowed type words; omitted, any non-empty type is allowed.
|
|
103
|
+
* @returns The parsed message, or `null` when it matches neither form.
|
|
104
|
+
* @task T12521
|
|
105
|
+
*/
|
|
106
|
+
export function parseReturnMessage(message, types) {
|
|
107
|
+
const lines = stripReturnFence(message.trim().split(/\r?\n/));
|
|
108
|
+
const typePattern = types ? types.map(escapeRegex).join('|') : '.+?';
|
|
109
|
+
const head = new RegExp(`^(${typePattern}) (${RETURN_STATUSES.join('|')})\\.(?:${escapeRegex(LEGACY_RETURN_TAIL)}| manifest:(\\S+))$`).exec(lines[0] ?? '');
|
|
110
|
+
const type = head?.[1];
|
|
111
|
+
const status = head?.[2];
|
|
112
|
+
if (!type || !status)
|
|
113
|
+
return null;
|
|
114
|
+
const entryId = head?.[3] ?? null;
|
|
115
|
+
const parsed = {
|
|
116
|
+
form: entryId ? 'compressed' : 'legacy',
|
|
117
|
+
type,
|
|
118
|
+
status,
|
|
119
|
+
entryId,
|
|
120
|
+
commits: null,
|
|
121
|
+
gates: null,
|
|
122
|
+
blocker: null,
|
|
123
|
+
};
|
|
124
|
+
if (parsed.form === 'legacy')
|
|
125
|
+
return lines.length === 1 ? parsed : null;
|
|
126
|
+
for (const line of lines.slice(1)) {
|
|
127
|
+
const detail = /^(\w+): (\S.*)$/.exec(line.trim());
|
|
128
|
+
const key = RETURN_DETAIL_KEYS.find((k) => k === detail?.[1]);
|
|
129
|
+
const value = detail?.[2]?.trim();
|
|
130
|
+
if (!key || !value || parsed[key] !== null)
|
|
131
|
+
return null;
|
|
132
|
+
parsed[key] = value;
|
|
133
|
+
}
|
|
134
|
+
if (/[<>]/.test(entryId ?? ''))
|
|
135
|
+
return null;
|
|
136
|
+
const done = status === 'complete' || status === 'completed';
|
|
137
|
+
const blocked = parsed.blocker !== null && parsed.blocker !== 'none';
|
|
138
|
+
if (done && (blocked || entryId === 'none'))
|
|
139
|
+
return null;
|
|
140
|
+
if (!done && !blocked)
|
|
141
|
+
return null;
|
|
142
|
+
return parsed;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Drop one surrounding ``` fence (with an optional info string) from the
|
|
146
|
+
* lines of a return message, so a block copied verbatim from the spawn
|
|
147
|
+
* prompt's template still parses (T12521).
|
|
148
|
+
*/
|
|
149
|
+
function stripReturnFence(lines) {
|
|
150
|
+
const first = lines[0]?.trim() ?? '';
|
|
151
|
+
const last = lines[lines.length - 1]?.trim() ?? '';
|
|
152
|
+
if (lines.length >= 3 && /^```[\w-]*$/.test(first) && last === '```') {
|
|
153
|
+
return lines.slice(1, -1).map((line) => line.trim());
|
|
154
|
+
}
|
|
155
|
+
return lines;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Check if return message follows protocol format — the compressed form
|
|
159
|
+
* (`<Type> <status>. manifest:<entryId>` plus optional detail lines) or the
|
|
160
|
+
* legacy one-liner (`<Type> <status>. Manifest appended to pipeline_manifest.`).
|
|
82
161
|
*
|
|
83
162
|
* When protocolType is provided, the message type must match the protocol
|
|
84
163
|
* (e.g., a 'research' protocol must produce a "Research ..." message).
|
|
85
164
|
*
|
|
86
165
|
* @task T4527
|
|
166
|
+
* @task T12521
|
|
87
167
|
*/
|
|
88
168
|
export function checkReturnMessageFormat(message, protocolType) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (protocolType) {
|
|
93
|
-
const expectedType = PROTOCOL_TYPE_MAP[protocolType.toLowerCase()];
|
|
94
|
-
if (!expectedType) {
|
|
95
|
-
// Unknown protocol type — fall back to allowing any valid type
|
|
96
|
-
typePattern = VALID_TYPES.join('|');
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
typePattern = expectedType;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
typePattern = VALID_TYPES.join('|');
|
|
104
|
-
}
|
|
105
|
-
const regex = new RegExp(`^(${typePattern}) (${statusPattern})\\. Manifest appended to pipeline_manifest\\.$`);
|
|
106
|
-
return regex.test(message);
|
|
169
|
+
// Unknown protocol type — fall back to allowing any valid type.
|
|
170
|
+
const expectedType = protocolType ? PROTOCOL_TYPE_MAP[protocolType.toLowerCase()] : undefined;
|
|
171
|
+
return parseReturnMessage(message, expectedType ? [expectedType] : VALID_TYPES) !== null;
|
|
107
172
|
}
|
|
108
173
|
// ============================================================================
|
|
109
174
|
// Manifest Field Validation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-common.js","sourceRoot":"","sources":["../../src/validation/protocol-common.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAmBxD,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAc,EACd,WAAmB,EACnB,OAAgB;IAEhB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,KAAK,CAAC;IAE3C,MAAM,WAAW,GAAG,OAAO,IAAI,GAAG,MAAM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C/E,UAAU;AACV,+EAA+E;AAE/E,SAAS,WAAW,CAAC,GAAW;IAC9B,OAAO,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC"}
|
package/migrations/README.md
CHANGED
|
@@ -236,6 +236,18 @@ Running `pnpm db:new -- --db signaldock` emits a warning and proceeds; the linte
|
|
|
236
236
|
any convention violations. Bringing signaldock fully into the `migration-manager.ts` runtime
|
|
237
237
|
is an epic-scale refactor out of scope for Wave 2A (ADR-054 R3 §6.1).
|
|
238
238
|
|
|
239
|
+
### sync-journal: not a drizzle lineage
|
|
240
|
+
|
|
241
|
+
`sync-journal/` holds the change journal's own tables (`_sync_meta`, `_sync_clock`,
|
|
242
|
+
`_sync_replica`; T12342). It is NOT a drizzle lineage: `migration-manager.ts`, drizzle-kit,
|
|
243
|
+
`pnpm db:new` and `scripts/lint-migrations.mjs` (which scans `drizzle-*` sets only) never touch
|
|
244
|
+
it. `packages/core/src/store/sync/schema.ts` applies its folders lazily, only when a `sync.*`
|
|
245
|
+
flag is first enabled on a store, so a store with every flag off gains no table and no journal
|
|
246
|
+
row. Each applied folder is journaled in `_sync_meta` as `schema:<folder>` with the sha256 of
|
|
247
|
+
its `migration.sql`, never in `__drizzle_migrations`; an applied folder whose SQL changed is
|
|
248
|
+
refused with `E_SYNC_SCHEMA_HASH_DRIFT`. Never edit an applied folder: add a new one, with the
|
|
249
|
+
same `YYYYMMDDHHMMSS_tNNNN-<slug>/migration.sql` naming.
|
|
250
|
+
|
|
239
251
|
---
|
|
240
252
|
|
|
241
253
|
## Linter Rules
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
-- T12341 (epic T12323) — row uids: the merge key of every syncing row.
|
|
2
|
+
--
|
|
3
|
+
-- Adds a nullable `uid` column (and a unique index on it) to the task-graph
|
|
4
|
+
-- tables whose live table is settled (no pending twin collapse), plus the
|
|
5
|
+
-- stored AC-uid references `ac_uid` on evidence bindings and AC history, and
|
|
6
|
+
-- the display-id alias table. Spec: `cleo docs fetch t12341-uid-scheme`.
|
|
7
|
+
--
|
|
8
|
+
-- The column is filled by TypeScript, not here: SQLite has no hash function,
|
|
9
|
+
-- and existing rows need a DETERMINISTIC uid so two devices that share a
|
|
10
|
+
-- history derive the same one (store/row-identity.ts, run at every open inside
|
|
11
|
+
-- the cold-open lease, right after the migrations). Nothing in this file
|
|
12
|
+
-- rebuilds a table, so the T12541 rebuild probe does not apply; if the journal
|
|
13
|
+
-- probe ever stamps this migration after adding only its columns (Scenario 3,
|
|
14
|
+
-- Case B), the open pass re-creates the indexes.
|
|
15
|
+
--
|
|
16
|
+
-- There is deliberately no persistent trigger: one that called the uid
|
|
17
|
+
-- function would fail every insert an older build makes (it lacks the
|
|
18
|
+
-- function), and one that minted a random uid would make those rows
|
|
19
|
+
-- non-deterministic. Rows an older build inserts keep a NULL uid until the next
|
|
20
|
+
-- open by this build fills them.
|
|
21
|
+
--
|
|
22
|
+
-- `birth_fp` (minted tables) is the birth fingerprint: a hash of creation
|
|
23
|
+
-- facts no edit changes, captured when the uid is assigned. Same uid with a
|
|
24
|
+
-- different birth_fp is a uid COLLISION the merge never merges (spec §6.4).
|
|
25
|
+
-- `ac_text_hash` on bindings is the hash of the AC text the evidence was
|
|
26
|
+
-- recorded against; a mismatch with the current text is stale evidence.
|
|
27
|
+
--
|
|
28
|
+
-- `tasks_display_id_aliases` follows the ADR-094 alias pattern (a live display
|
|
29
|
+
-- id always wins; an alias resolves only when no live row holds the id;
|
|
30
|
+
-- several aliases are an error). `tasks_uid_aliases` records uid re-keys after
|
|
31
|
+
-- a collision. Both are runtime infrastructure written by
|
|
32
|
+
-- store/display-id-alias.ts, not part of the exodus target shape.
|
|
33
|
+
--
|
|
34
|
+
-- `tasks_identity_quarantine` (local-only) holds incoming rows a merge cannot
|
|
35
|
+
-- place yet: the loser of a uid or display-id collision until its authority's
|
|
36
|
+
-- re-key / re-mint arrives, and rows whose references wait on one (spec §6.4).
|
|
37
|
+
--
|
|
38
|
+
-- `tasks_row_identity_meta` (local-only) holds the identity recipe version the
|
|
39
|
+
-- store's values were derived with, and the sync layer's "uids have synced"
|
|
40
|
+
-- marker (spec §12.1).
|
|
41
|
+
--
|
|
42
|
+
-- `tasks_ac_uid_graveyard` and its PURE-SQL delete trigger record the uid of a
|
|
43
|
+
-- deleted acceptance criterion, so the next open by this build can re-link a
|
|
44
|
+
-- criterion an older build deleted and recreated without carrying its uid
|
|
45
|
+
-- (spec §6.5). The trigger calls no function, so older builds run it as is.
|
|
46
|
+
--
|
|
47
|
+
-- @task T12341
|
|
48
|
+
-- @epic T12323
|
|
49
|
+
|
|
50
|
+
ALTER TABLE `tasks_tasks` ADD COLUMN `uid` TEXT;
|
|
51
|
+
--> statement-breakpoint
|
|
52
|
+
ALTER TABLE `tasks_task_acceptance_criteria` ADD COLUMN `uid` TEXT;
|
|
53
|
+
--> statement-breakpoint
|
|
54
|
+
ALTER TABLE `tasks_task_acceptance_criteria_history` ADD COLUMN `uid` TEXT;
|
|
55
|
+
--> statement-breakpoint
|
|
56
|
+
ALTER TABLE `tasks_task_acceptance_criteria_history` ADD COLUMN `ac_uid` TEXT;
|
|
57
|
+
--> statement-breakpoint
|
|
58
|
+
ALTER TABLE `tasks_evidence_ac_bindings` ADD COLUMN `uid` TEXT;
|
|
59
|
+
--> statement-breakpoint
|
|
60
|
+
ALTER TABLE `tasks_evidence_ac_bindings` ADD COLUMN `ac_uid` TEXT;
|
|
61
|
+
--> statement-breakpoint
|
|
62
|
+
ALTER TABLE `tasks_sessions` ADD COLUMN `uid` TEXT;
|
|
63
|
+
--> statement-breakpoint
|
|
64
|
+
ALTER TABLE `tasks_task_dependencies` ADD COLUMN `uid` TEXT;
|
|
65
|
+
--> statement-breakpoint
|
|
66
|
+
ALTER TABLE `tasks_task_relations` ADD COLUMN `uid` TEXT;
|
|
67
|
+
--> statement-breakpoint
|
|
68
|
+
ALTER TABLE `tasks_task_labels` ADD COLUMN `uid` TEXT;
|
|
69
|
+
--> statement-breakpoint
|
|
70
|
+
ALTER TABLE `tasks_tasks` ADD COLUMN `birth_fp` TEXT;
|
|
71
|
+
--> statement-breakpoint
|
|
72
|
+
ALTER TABLE `tasks_task_acceptance_criteria` ADD COLUMN `birth_fp` TEXT;
|
|
73
|
+
--> statement-breakpoint
|
|
74
|
+
ALTER TABLE `tasks_task_acceptance_criteria_history` ADD COLUMN `birth_fp` TEXT;
|
|
75
|
+
--> statement-breakpoint
|
|
76
|
+
ALTER TABLE `tasks_evidence_ac_bindings` ADD COLUMN `birth_fp` TEXT;
|
|
77
|
+
--> statement-breakpoint
|
|
78
|
+
ALTER TABLE `tasks_evidence_ac_bindings` ADD COLUMN `ac_text_hash` TEXT;
|
|
79
|
+
--> statement-breakpoint
|
|
80
|
+
ALTER TABLE `tasks_sessions` ADD COLUMN `birth_fp` TEXT;
|
|
81
|
+
--> statement-breakpoint
|
|
82
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `uq_tasks_tasks_uid` ON `tasks_tasks` (`uid`);
|
|
83
|
+
--> statement-breakpoint
|
|
84
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `uq_tasks_task_acceptance_criteria_uid` ON `tasks_task_acceptance_criteria` (`uid`);
|
|
85
|
+
--> statement-breakpoint
|
|
86
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `uq_tasks_task_acceptance_criteria_history_uid` ON `tasks_task_acceptance_criteria_history` (`uid`);
|
|
87
|
+
--> statement-breakpoint
|
|
88
|
+
CREATE INDEX IF NOT EXISTS `idx_tasks_task_acceptance_criteria_history_ac_uid` ON `tasks_task_acceptance_criteria_history` (`ac_uid`);
|
|
89
|
+
--> statement-breakpoint
|
|
90
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `uq_tasks_evidence_ac_bindings_uid` ON `tasks_evidence_ac_bindings` (`uid`);
|
|
91
|
+
--> statement-breakpoint
|
|
92
|
+
CREATE INDEX IF NOT EXISTS `idx_tasks_evidence_ac_bindings_ac_uid` ON `tasks_evidence_ac_bindings` (`ac_uid`);
|
|
93
|
+
--> statement-breakpoint
|
|
94
|
+
CREATE INDEX IF NOT EXISTS `idx_tasks_evidence_ac_bindings_ac_text_hash` ON `tasks_evidence_ac_bindings` (`ac_text_hash`);
|
|
95
|
+
--> statement-breakpoint
|
|
96
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `uq_tasks_sessions_uid` ON `tasks_sessions` (`uid`);
|
|
97
|
+
--> statement-breakpoint
|
|
98
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `uq_tasks_task_dependencies_uid` ON `tasks_task_dependencies` (`uid`);
|
|
99
|
+
--> statement-breakpoint
|
|
100
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `uq_tasks_task_relations_uid` ON `tasks_task_relations` (`uid`);
|
|
101
|
+
--> statement-breakpoint
|
|
102
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `uq_tasks_task_labels_uid` ON `tasks_task_labels` (`uid`);
|
|
103
|
+
--> statement-breakpoint
|
|
104
|
+
CREATE TABLE IF NOT EXISTS `tasks_display_id_aliases` (
|
|
105
|
+
`uid` TEXT PRIMARY KEY NOT NULL,
|
|
106
|
+
`entity_table` TEXT NOT NULL,
|
|
107
|
+
`display_id` TEXT NOT NULL,
|
|
108
|
+
`entity_uid` TEXT NOT NULL,
|
|
109
|
+
`reason` TEXT NOT NULL,
|
|
110
|
+
`origin` TEXT,
|
|
111
|
+
`displaced_hlc` TEXT,
|
|
112
|
+
`created_at` TEXT NOT NULL,
|
|
113
|
+
`entity_birth_fp` TEXT
|
|
114
|
+
);
|
|
115
|
+
--> statement-breakpoint
|
|
116
|
+
CREATE INDEX IF NOT EXISTS `idx_tasks_display_id_aliases_lookup` ON `tasks_display_id_aliases` (`entity_table`, `display_id`);
|
|
117
|
+
--> statement-breakpoint
|
|
118
|
+
CREATE INDEX IF NOT EXISTS `idx_tasks_display_id_aliases_entity` ON `tasks_display_id_aliases` (`entity_uid`);
|
|
119
|
+
--> statement-breakpoint
|
|
120
|
+
CREATE TABLE IF NOT EXISTS `tasks_uid_aliases` (
|
|
121
|
+
`uid` TEXT PRIMARY KEY NOT NULL,
|
|
122
|
+
`entity_table` TEXT NOT NULL,
|
|
123
|
+
`old_uid` TEXT NOT NULL,
|
|
124
|
+
`old_birth_fp` TEXT NOT NULL,
|
|
125
|
+
`new_uid` TEXT NOT NULL,
|
|
126
|
+
`origin` TEXT,
|
|
127
|
+
`displaced_hlc` TEXT,
|
|
128
|
+
`created_at` TEXT NOT NULL
|
|
129
|
+
);
|
|
130
|
+
--> statement-breakpoint
|
|
131
|
+
CREATE INDEX IF NOT EXISTS `idx_tasks_uid_aliases_old` ON `tasks_uid_aliases` (`entity_table`, `old_uid`);
|
|
132
|
+
--> statement-breakpoint
|
|
133
|
+
CREATE TABLE IF NOT EXISTS `tasks_ac_uid_graveyard` (
|
|
134
|
+
`seq` INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
135
|
+
`ac_id` TEXT NOT NULL,
|
|
136
|
+
`uid` TEXT NOT NULL,
|
|
137
|
+
`task_id` TEXT NOT NULL,
|
|
138
|
+
`ordinal` INTEGER NOT NULL,
|
|
139
|
+
`text` TEXT NOT NULL,
|
|
140
|
+
`birth_fp` TEXT,
|
|
141
|
+
`deleted_at` TEXT NOT NULL
|
|
142
|
+
);
|
|
143
|
+
--> statement-breakpoint
|
|
144
|
+
CREATE INDEX IF NOT EXISTS `idx_tasks_ac_uid_graveyard_task` ON `tasks_ac_uid_graveyard` (`task_id`);
|
|
145
|
+
--> statement-breakpoint
|
|
146
|
+
CREATE TRIGGER IF NOT EXISTS `trg_tasks_ac_uid_graveyard`
|
|
147
|
+
AFTER DELETE ON `tasks_task_acceptance_criteria`
|
|
148
|
+
WHEN OLD.`uid` IS NOT NULL
|
|
149
|
+
BEGIN
|
|
150
|
+
INSERT INTO `tasks_ac_uid_graveyard` (`ac_id`, `uid`, `task_id`, `ordinal`, `text`, `birth_fp`, `deleted_at`)
|
|
151
|
+
VALUES (OLD.`id`, OLD.`uid`, OLD.`task_id`, OLD.`ordinal`, OLD.`text`, OLD.`birth_fp`, strftime('%Y-%m-%dT%H:%M:%fZ', 'now'));
|
|
152
|
+
END;
|
|
153
|
+
--> statement-breakpoint
|
|
154
|
+
CREATE TABLE IF NOT EXISTS `tasks_row_identity_meta` (
|
|
155
|
+
`key` TEXT PRIMARY KEY NOT NULL,
|
|
156
|
+
`value` TEXT NOT NULL
|
|
157
|
+
);
|
|
158
|
+
--> statement-breakpoint
|
|
159
|
+
CREATE TABLE IF NOT EXISTS `tasks_identity_quarantine` (
|
|
160
|
+
`entity_table` TEXT NOT NULL,
|
|
161
|
+
`uid` TEXT NOT NULL,
|
|
162
|
+
`birth_fp` TEXT NOT NULL,
|
|
163
|
+
`reason` TEXT NOT NULL,
|
|
164
|
+
`contested_id` TEXT,
|
|
165
|
+
`row_json` TEXT NOT NULL,
|
|
166
|
+
`received_hlc` TEXT,
|
|
167
|
+
`created_at` TEXT NOT NULL,
|
|
168
|
+
PRIMARY KEY (`entity_table`, `uid`, `birth_fp`)
|
|
169
|
+
);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
-- T12342 — change journal (S1): store-level sync flags, the HLC clock and the
|
|
2
|
+
-- replica binding. Journal spec t12342-t12343-journal-design §1.4, §1.5, §5.1.
|
|
3
|
+
--
|
|
4
|
+
-- NOT a drizzle migration. The sync schema is applied lazily by
|
|
5
|
+
-- packages/core/src/store/sync/schema.ts, and only when a sync.* flag is first
|
|
6
|
+
-- enabled on a store. With every flag off (the default), opening a store
|
|
7
|
+
-- writes nothing: no table, no journal row. Applied folders are journaled in
|
|
8
|
+
-- _sync_meta under the key 'schema:<folder name>', never in
|
|
9
|
+
-- __drizzle_migrations.
|
|
10
|
+
--
|
|
11
|
+
-- All three tables are local-only (never synced; tier-1 backed up like every
|
|
12
|
+
-- table) and identical in the project and the global store. Statements are
|
|
13
|
+
-- separated by the drizzle breakpoint marker line, like the drizzle lineages.
|
|
14
|
+
--
|
|
15
|
+
-- @task T12342
|
|
16
|
+
|
|
17
|
+
CREATE TABLE IF NOT EXISTS _sync_meta (
|
|
18
|
+
key TEXT PRIMARY KEY,
|
|
19
|
+
value TEXT NOT NULL,
|
|
20
|
+
updated_at TEXT NOT NULL
|
|
21
|
+
) WITHOUT ROWID;
|
|
22
|
+
--> statement-breakpoint
|
|
23
|
+
CREATE TABLE IF NOT EXISTS _sync_clock (
|
|
24
|
+
replica_id TEXT PRIMARY KEY,
|
|
25
|
+
phys INTEGER NOT NULL CHECK (phys >= 0),
|
|
26
|
+
ctr INTEGER NOT NULL CHECK (ctr BETWEEN 0 AND 999999)
|
|
27
|
+
) WITHOUT ROWID;
|
|
28
|
+
--> statement-breakpoint
|
|
29
|
+
CREATE TABLE IF NOT EXISTS _sync_replica (
|
|
30
|
+
replica_id TEXT PRIMARY KEY,
|
|
31
|
+
scope TEXT NOT NULL CHECK (scope IN ('project', 'global')),
|
|
32
|
+
nonce TEXT NOT NULL,
|
|
33
|
+
device_id TEXT NOT NULL,
|
|
34
|
+
file_ino INTEGER NOT NULL,
|
|
35
|
+
file_birth INTEGER,
|
|
36
|
+
bound_at TEXT NOT NULL,
|
|
37
|
+
bound_why TEXT NOT NULL,
|
|
38
|
+
retired_at TEXT,
|
|
39
|
+
successor TEXT
|
|
40
|
+
) WITHOUT ROWID;
|
|
41
|
+
--> statement-breakpoint
|
|
42
|
+
CREATE UNIQUE INDEX IF NOT EXISTS _sync_replica_active ON _sync_replica (scope) WHERE retired_at IS NULL;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/core",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.25",
|
|
4
4
|
"description": "CLEO core business logic kernel — tasks, sessions, memory, orchestration, lifecycle, with bundled SQLite store",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -491,16 +491,16 @@
|
|
|
491
491
|
"write-file-atomic": "^7.0.1",
|
|
492
492
|
"yaml": "^2.8.3",
|
|
493
493
|
"zod": "^4.3.6",
|
|
494
|
-
"@cleocode/
|
|
495
|
-
"@cleocode/
|
|
496
|
-
"@cleocode/
|
|
497
|
-
"@cleocode/contracts": "2026.9.
|
|
498
|
-
"@cleocode/git-shim": "2026.9.
|
|
499
|
-
"@cleocode/lafs": "2026.9.
|
|
500
|
-
"@cleocode/
|
|
501
|
-
"@cleocode/
|
|
502
|
-
"@cleocode/
|
|
503
|
-
"@cleocode/worktree": "2026.9.
|
|
494
|
+
"@cleocode/agents": "2026.9.25",
|
|
495
|
+
"@cleocode/caamp": "2026.9.25",
|
|
496
|
+
"@cleocode/adapters": "2026.9.25",
|
|
497
|
+
"@cleocode/contracts": "2026.9.25",
|
|
498
|
+
"@cleocode/git-shim": "2026.9.25",
|
|
499
|
+
"@cleocode/lafs": "2026.9.25",
|
|
500
|
+
"@cleocode/paths": "2026.9.25",
|
|
501
|
+
"@cleocode/skills": "2026.9.25",
|
|
502
|
+
"@cleocode/nexus": "2026.9.25",
|
|
503
|
+
"@cleocode/worktree": "2026.9.25"
|
|
504
504
|
},
|
|
505
505
|
"engines": {
|
|
506
506
|
"node": ">=24.16.0"
|
|
@@ -526,7 +526,7 @@
|
|
|
526
526
|
"@types/proper-lockfile": "^4.1.4",
|
|
527
527
|
"@types/tar": "^6.1.13",
|
|
528
528
|
"@types/write-file-atomic": "^4.0.3",
|
|
529
|
-
"@cleocode/utils": "2026.9.
|
|
529
|
+
"@cleocode/utils": "2026.9.25"
|
|
530
530
|
},
|
|
531
531
|
"repository": {
|
|
532
532
|
"type": "git",
|
|
@@ -535,7 +535,7 @@
|
|
|
535
535
|
},
|
|
536
536
|
"optionalDependencies": {
|
|
537
537
|
"llmtxt": "^2026.5.15",
|
|
538
|
-
"@cleocode/studio": "^2026.9.
|
|
538
|
+
"@cleocode/studio": "^2026.9.25"
|
|
539
539
|
},
|
|
540
540
|
"scripts": {
|
|
541
541
|
"build": "tsc && node scripts/copy-selfimprove-fixtures.mjs && node scripts/write-build-provenance.mjs",
|
|
@@ -303,5 +303,9 @@ All overrides append a line to `.cleo/audit/force-bypass.jsonl`. Use sparingly.
|
|
|
303
303
|
|
|
304
304
|
A task PR merged into an integration branch is a component: `pr:<component>@<integration>` (and `ci:<component>@<integration>`) takes the merge commit and CI from the integration PR that landed it, and the task linkage and changed files from the component PR — only its files that survive the integration merge, never the whole integration diff (T12671). `cleo done` derives this from either PR number. A file a later change also edited still counts while the component's own hunks apply to the landed version. A component that only deleted files implements with `pr:<component>@<integration>;note:<deleted paths>`, because a deletion has no bytes for `files:`.
|
|
305
305
|
|
|
306
|
+
### `ci:<number>` merge-commit CI atom (D11149 · T12742)
|
|
307
|
+
|
|
308
|
+
With `evidence.ciSatisfies: true`, `ci:<number>` attests `testsPassed`/`qaPassed` from the required checks (`evidence.ciChecks`) green on the merged PR's merge commit, or on a final PR head whose tree equals it. When a concurrency group CANCELLED (or skipped) the merge commit's own push run, a later default-branch commit's green `push` run may stand in (T12742). That run proves the DESCENDANT's tree, not the merge tree, so it counts only when all of these hold: no merge-commit run or job failed; the PR's final head has a green latest `pull_request` run for every stood-in check; the commit descends from the merge commit and is one of the first 10 first-parent commits within 7 days; NO commit between them, merge commits included, touched the PR's changed files, a pinned workflow file or `.github/actions`; and it is the first candidate with a decisive verdict. A red first decisive candidate refuses, and a pending one refuses with "wait for <sha>"; only cancelled, skipped or never-started runs move on. The atom records `descendantSha`, `descendantRange` and `descendantPrHeadSha`, and `cleo complete` re-fetches both runs' latest attempts, because a re-run can turn a completed check red.
|
|
309
|
+
|
|
306
310
|
Required checks: explicit configuration or target repository protection. `release.prRequiredWorkflows: []` requires no checks; it proves neither testing nor review. `.cleo/cache/evidence/pr-<num>.json` retains provenance and changed files; obsolete versions reject. Use `tool:test` or `test-run:<json>` plus appropriate QA tools, linking each result to verified criteria.
|
|
307
311
|
<!-- /CLEO-INJECTION:section=evidence -->
|