@dzhechkov/harness-core 0.8.46 → 0.8.47
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/.dz-manifest.json +175 -163
- package/README.md +84 -2
- package/dist/agentdb-index.d.ts.map +1 -1
- package/dist/agentdb-index.js +32 -2
- package/dist/agentdb-index.js.map +1 -1
- package/dist/agentdb-snapshot.d.ts +14 -1
- package/dist/agentdb-snapshot.d.ts.map +1 -1
- package/dist/agentdb-snapshot.js +100 -4
- package/dist/agentdb-snapshot.js.map +1 -1
- package/dist/apply-leg.d.ts +9 -1
- package/dist/apply-leg.d.ts.map +1 -1
- package/dist/apply-leg.js +26 -4
- package/dist/apply-leg.js.map +1 -1
- package/dist/architecture.d.ts +0 -5
- package/dist/architecture.d.ts.map +1 -1
- package/dist/architecture.js +25 -2
- package/dist/architecture.js.map +1 -1
- package/dist/codex-rollouts.d.ts +35 -7
- package/dist/codex-rollouts.d.ts.map +1 -1
- package/dist/codex-rollouts.js +201 -113
- package/dist/codex-rollouts.js.map +1 -1
- package/dist/cost-ledger.d.ts +42 -3
- package/dist/cost-ledger.d.ts.map +1 -1
- package/dist/cost-ledger.js +478 -15
- package/dist/cost-ledger.js.map +1 -1
- package/dist/feature-adr-routing.d.ts +16 -0
- package/dist/feature-adr-routing.d.ts.map +1 -1
- package/dist/feature-adr-routing.js +21 -0
- package/dist/feature-adr-routing.js.map +1 -1
- package/dist/guard.d.ts +7 -0
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +48 -0
- package/dist/guard.js.map +1 -1
- package/dist/index.d.ts +11 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/loop-plan.d.ts +4 -0
- package/dist/loop-plan.d.ts.map +1 -1
- package/dist/loop-plan.js +4 -0
- package/dist/loop-plan.js.map +1 -1
- package/dist/mutation-gate.d.ts +36 -1
- package/dist/mutation-gate.d.ts.map +1 -1
- package/dist/mutation-gate.js +109 -19
- package/dist/mutation-gate.js.map +1 -1
- package/dist/npm-homepage.d.ts +64 -0
- package/dist/npm-homepage.d.ts.map +1 -0
- package/dist/npm-homepage.js +109 -0
- package/dist/npm-homepage.js.map +1 -0
- package/dist/operations.d.ts +6 -0
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +150 -24
- package/dist/operations.js.map +1 -1
- package/dist/pack-inventory.d.ts.map +1 -1
- package/dist/pack-inventory.js +6 -1
- package/dist/pack-inventory.js.map +1 -1
- package/dist/parity.d.ts.map +1 -1
- package/dist/parity.js +4 -1
- package/dist/parity.js.map +1 -1
- package/dist/publish-sibling-drift.d.ts +43 -1
- package/dist/publish-sibling-drift.d.ts.map +1 -1
- package/dist/publish-sibling-drift.js +269 -13
- package/dist/publish-sibling-drift.js.map +1 -1
- package/dist/publish.d.ts +5 -1
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +18 -1
- package/dist/publish.js.map +1 -1
- package/dist/qe-bridge.d.ts +63 -1
- package/dist/qe-bridge.d.ts.map +1 -1
- package/dist/qe-bridge.js +82 -0
- package/dist/qe-bridge.js.map +1 -1
- package/dist/release-package-audit.d.ts +86 -0
- package/dist/release-package-audit.d.ts.map +1 -0
- package/dist/release-package-audit.js +272 -0
- package/dist/release-package-audit.js.map +1 -0
- package/dist/release.d.ts +8 -1
- package/dist/release.d.ts.map +1 -1
- package/dist/release.js +58 -32
- package/dist/release.js.map +1 -1
- package/dist/round.d.ts +10 -1
- package/dist/round.d.ts.map +1 -1
- package/dist/round.js +5 -1
- package/dist/round.js.map +1 -1
- package/dist/run-records.d.ts +11 -0
- package/dist/run-records.d.ts.map +1 -1
- package/dist/run-records.js +124 -20
- package/dist/run-records.js.map +1 -1
- package/dist/stage-usage.d.ts +148 -0
- package/dist/stage-usage.d.ts.map +1 -0
- package/dist/stage-usage.js +261 -0
- package/dist/stage-usage.js.map +1 -0
- package/dist/statusline.d.ts +23 -0
- package/dist/statusline.d.ts.map +1 -1
- package/dist/statusline.js +167 -1
- package/dist/statusline.js.map +1 -1
- package/dist/workflow-run-dispatch.d.ts +21 -19
- package/dist/workflow-run-dispatch.d.ts.map +1 -1
- package/dist/workflow-run-dispatch.js +206 -95
- package/dist/workflow-run-dispatch.js.map +1 -1
- package/dist/workflow-run.d.ts +12 -3
- package/dist/workflow-run.d.ts.map +1 -1
- package/dist/workflow-run.js +29 -2
- package/dist/workflow-run.js.map +1 -1
- package/package.json +3 -3
- package/sbom.json +264 -234
- package/src/agentdb-index.ts +31 -2
- package/src/agentdb-snapshot.ts +105 -4
- package/src/apply-leg.ts +26 -4
- package/src/architecture.ts +15 -2
- package/src/codex-rollouts.ts +155 -147
- package/src/cost-ledger.ts +308 -19
- package/src/feature-adr-routing.ts +22 -0
- package/src/guard.ts +52 -0
- package/src/index.ts +15 -3
- package/src/loop-plan.ts +8 -0
- package/src/mutation-gate.ts +153 -19
- package/src/npm-homepage.ts +142 -0
- package/src/operations.ts +177 -22
- package/src/pack-inventory.ts +6 -1
- package/src/parity.ts +4 -1
- package/src/publish-sibling-drift.ts +214 -11
- package/src/publish.ts +20 -1
- package/src/qe-bridge.ts +86 -1
- package/src/release-package-audit.ts +264 -0
- package/src/release.ts +55 -22
- package/src/round.ts +8 -0
- package/src/run-records.ts +101 -22
- package/src/stage-usage.ts +191 -0
- package/src/statusline.ts +149 -1
- package/src/workflow-run-dispatch.ts +148 -89
- package/src/workflow-run.ts +40 -4
- package/dist/ledger-cost-fill.d.ts +0 -58
- package/dist/ledger-cost-fill.d.ts.map +0 -1
- package/dist/ledger-cost-fill.js +0 -78
- package/dist/ledger-cost-fill.js.map +0 -1
- package/dist/retro.d.ts +0 -131
- package/dist/retro.d.ts.map +0 -1
- package/dist/retro.js +0 -207
- package/dist/retro.js.map +0 -1
- package/dist/sbom.d.ts +0 -42
- package/dist/sbom.d.ts.map +0 -1
- package/dist/sbom.js +0 -120
- package/dist/sbom.js.map +0 -1
package/dist/operations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,EAWL,KAAK,eAAe,EAEpB,KAAK,qBAAqB,EAE3B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAoBjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAML,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAoD,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACtH,OAAO,EAA2B,KAAK,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAM5B,mCAAmC;AACnC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,4CAA4C;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,6EA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;IACxD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClD;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,sEAAsE;IACtE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,iBAAiB,CAgFnF;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAShH;AA8LD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,GAAE,MAAsB,GAAG,SAAS,qBAAqB,EAAE,GAAG,IAAI,CAyBtH"}
|
package/dist/operations.js
CHANGED
|
@@ -11,7 +11,7 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpath
|
|
|
11
11
|
import { homedir, tmpdir } from 'node:os';
|
|
12
12
|
import { dirname, join, resolve as resolvePath } from 'node:path';
|
|
13
13
|
import { fileURLToPath } from 'node:url';
|
|
14
|
-
import { buildManagedEntries, buildCodexHookManifest, codexHooksPaths, diffCodexHooks, parseCodexHookManifest, planCodexHooks, removeCodexHooks, selectOwnHookMetadata, upsertTrustBlock, } from './codex-hooks.js';
|
|
14
|
+
import { buildManagedEntries, buildCodexHookManifest, codexHooksPaths, diffCodexHooks, looksLikeDzEntry, parseCodexHookManifest, planCodexHooks, removeCodexHooks, selectOwnHookMetadata, upsertTrustBlock, } from './codex-hooks.js';
|
|
15
15
|
import { sweepSkillDrift } from './skill-drift.js';
|
|
16
16
|
import { generateCodexHelpers } from './codex-hooks-assets.js';
|
|
17
17
|
import { classifyVetoProbe, isReadyVerdict, verifyExitCode, } from './codex-hooks-verify.js';
|
|
@@ -1812,25 +1812,46 @@ export function runSyncCodexHooks(options = {}) {
|
|
|
1812
1812
|
// 2 deleted them after the lock was released, so a concurrent installer could observe (and
|
|
1813
1813
|
// rebuild against) a registry that had already been emptied — or leave a manifest describing
|
|
1814
1814
|
// entries that no longer exist. One decision, one critical section.
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1815
|
+
//
|
|
1816
|
+
// codex-hooks-remove-never-orphans (ADR-001): the helpers go ONLY when nothing left in the
|
|
1817
|
+
// registry still points at them. Keyed on the OBSERVED fact — dz-like entries surviving this
|
|
1818
|
+
// plan — not on a flag: an installer between its two sections (no manifest yet), or a manifest
|
|
1819
|
+
// deleted by hand, leaves entries we cannot attribute; deleting their helpers anyway turned the
|
|
1820
|
+
// entry into `exit 127`, which Codex reads as ALLOW. A dead reference is worse than a stray file.
|
|
1821
|
+
//
|
|
1822
|
+
// Review r1 item 3: "nothing left points at them" is measured on the registry AS IT WILL BE
|
|
1823
|
+
// WRITTEN — every surviving handler, attributed-and-salvaged or not. `unattributable` counts
|
|
1824
|
+
// whole unattributed entries only; a handler salvaged from an attributed matcher group (another
|
|
1825
|
+
// interpreter sharing these helpers) would slip past it and lose its helper.
|
|
1826
|
+
if (!planned.ok)
|
|
1827
|
+
return { planned, references: 0 };
|
|
1828
|
+
const references = dzHelperReferences(planned.result.registry);
|
|
1829
|
+
const doomed = references > 0 ? [paths.manifest] : [paths.vetoHelper, paths.recallHelper, paths.manifest];
|
|
1830
|
+
for (const p of doomed)
|
|
1831
|
+
rmSync(p, { force: true });
|
|
1832
|
+
return { planned, references };
|
|
1820
1833
|
});
|
|
1821
|
-
|
|
1822
|
-
|
|
1834
|
+
const planned = removal.planned;
|
|
1835
|
+
if (!planned.ok)
|
|
1836
|
+
return { ...base, codexVersion, exitCode: 1, warnings, errors: [planned.error] };
|
|
1837
|
+
// A remove that leaves dz references in the registry did not remove dz — it must not say it did.
|
|
1838
|
+
const kept = removal.references;
|
|
1823
1839
|
return {
|
|
1824
1840
|
...base,
|
|
1825
1841
|
codexVersion,
|
|
1826
|
-
written:
|
|
1827
|
-
removed:
|
|
1828
|
-
unattributable:
|
|
1829
|
-
exitCode: 0,
|
|
1830
|
-
warnings
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1842
|
+
written: planned.result.changed,
|
|
1843
|
+
removed: planned.result.removed,
|
|
1844
|
+
unattributable: planned.result.unattributable,
|
|
1845
|
+
exitCode: kept > 0 ? 1 : 0,
|
|
1846
|
+
warnings,
|
|
1847
|
+
errors: kept > 0
|
|
1848
|
+
? [
|
|
1849
|
+
`remove-unattributed-entries-kept: ${kept} handler(s) in ${paths.registry} still reference the dz helpers but are ` +
|
|
1850
|
+
'not manifest-attributed, so they were KEPT — and the helper files they reference were KEPT with them ' +
|
|
1851
|
+
'(deleting a referenced helper makes the hook exit 127, which Codex treats as ALLOW). An install may be ' +
|
|
1852
|
+
'in flight: let it finish and re-run `--remove`; otherwise delete those entries by hand, then re-run.',
|
|
1853
|
+
]
|
|
1854
|
+
: errors,
|
|
1834
1855
|
writes,
|
|
1835
1856
|
};
|
|
1836
1857
|
}
|
|
@@ -1912,8 +1933,8 @@ export function runSyncCodexHooks(options = {}) {
|
|
|
1912
1933
|
return { plan, wrote: false, freshText };
|
|
1913
1934
|
mkdirSync(paths.helperDir, { recursive: true, mode: 0o700 });
|
|
1914
1935
|
const helpers = generateCodexHelpers();
|
|
1915
|
-
writeHelperIfChanged(paths.vetoHelper, helpers.veto, writes);
|
|
1916
|
-
writeHelperIfChanged(paths.recallHelper, helpers.recall, writes);
|
|
1936
|
+
writeHelperIfChanged(paths.vetoHelper, helpers.veto, writes, options.writeHelperFile);
|
|
1937
|
+
writeHelperIfChanged(paths.recallHelper, helpers.recall, writes, options.writeHelperFile);
|
|
1917
1938
|
if (plan.plan.changed) {
|
|
1918
1939
|
backupRegistry(paths, freshText, now, writes);
|
|
1919
1940
|
atomicWrite(paths.registry, plan.plan.text);
|
|
@@ -1966,18 +1987,60 @@ export function runSyncCodexHooks(options = {}) {
|
|
|
1966
1987
|
const nowText = existsSync(paths.registry) ? readFileSync(paths.registry, 'utf8') : undefined;
|
|
1967
1988
|
const nowDrift = diffCodexHooks(nowText, entries, undefined);
|
|
1968
1989
|
if (!nowDrift.installed) {
|
|
1969
|
-
return { wrote: false, drift: nowDrift };
|
|
1990
|
+
return { wrote: false, drift: nowDrift, restored: false, restoreFailure: null };
|
|
1991
|
+
}
|
|
1992
|
+
// codex-hooks-remove-never-orphans (ADR-001): the entries are ours and present — so are their
|
|
1993
|
+
// helpers, or the registry points into nothing (exit 127 = ALLOW). Something that ignores the lock
|
|
1994
|
+
// (an older dz's `--remove`, a hand) may have deleted or altered them since section one. Re-assert
|
|
1995
|
+
// them HERE, under the lock, before the manifest calls this install complete. Two small writes,
|
|
1996
|
+
// no probe: the section stays a short transaction.
|
|
1997
|
+
const before = writes.length;
|
|
1998
|
+
try {
|
|
1999
|
+
mkdirSync(paths.helperDir, { recursive: true, mode: 0o700 });
|
|
2000
|
+
const helpers = generateCodexHelpers();
|
|
2001
|
+
writeHelperIfChanged(paths.vetoHelper, helpers.veto, writes, options.writeHelperFile);
|
|
2002
|
+
writeHelperIfChanged(paths.recallHelper, helpers.recall, writes, options.writeHelperFile);
|
|
2003
|
+
}
|
|
2004
|
+
catch (err) {
|
|
2005
|
+
// Review r1 item 1: the restore FAILED (ENOSPC, a file where the helper dir should be, …). The
|
|
2006
|
+
// entries this install wrote now point at helpers that may not exist — fail CLOSED on the
|
|
2007
|
+
// invariant: take OUR entries back out of the registry (same lock, same transaction), write no
|
|
2008
|
+
// manifest, and let the report say why. Foreign entries are untouched by construction:
|
|
2009
|
+
// `removeCodexHooks` attributes by the hashes of the commands this very run emitted.
|
|
2010
|
+
return {
|
|
2011
|
+
wrote: false,
|
|
2012
|
+
drift: nowDrift,
|
|
2013
|
+
restored: false,
|
|
2014
|
+
restoreFailure: rollBackOwnEntries(paths, entries, nowText, manifestText, `${now}-rollback`, writes, String(err?.message ?? err)),
|
|
2015
|
+
};
|
|
1970
2016
|
}
|
|
2017
|
+
const restored = writes.length > before;
|
|
1971
2018
|
atomicWrite(paths.manifest, manifestText);
|
|
1972
2019
|
writes.push(paths.manifest);
|
|
1973
|
-
return { wrote: true, drift: nowDrift };
|
|
2020
|
+
return { wrote: true, drift: nowDrift, restored, restoreFailure: null };
|
|
1974
2021
|
});
|
|
1975
|
-
if (
|
|
2022
|
+
if (manifestOutcome.restoreFailure !== null) {
|
|
2023
|
+
const f = manifestOutcome.restoreFailure;
|
|
2024
|
+
errors.push(`helpers-restore-failed: the helper files were missing or altered after the registry transaction and could not be ` +
|
|
2025
|
+
`rewritten (${f.cause}). ` +
|
|
2026
|
+
(f.rolledBack
|
|
2027
|
+
? 'This install\u2019s own entries were REMOVED from the registry again, so none of THEM references a missing helper (exit 127 = ALLOW); no manifest was written.'
|
|
2028
|
+
: `Rolling this install\u2019s entries back ALSO failed (${f.rollbackError ?? 'unknown'}) — ${paths.registry} may reference a missing helper: fix the disk and re-run, or run \`--remove\`.`) +
|
|
2029
|
+
(f.missing.length > 0
|
|
2030
|
+
? ` Missing helper path(s): ${f.missing.join(', ')}. Handlers not written by this run that reference these paths were left untouched and will exit 127 (Codex reads that as ALLOW) — run \`dz hooks-sync --target codex --check\` and repair.`
|
|
2031
|
+
: ''));
|
|
2032
|
+
}
|
|
2033
|
+
if (manifestOutcome.restored) {
|
|
2034
|
+
warnings.push('helpers-restored: the helper files were missing or altered between the registry transaction and the manifest ' +
|
|
2035
|
+
'write (an older dz `--remove`, or a process that ignores the codex-hooks lock) — they were rewritten under the lock so the ' +
|
|
2036
|
+
'registry never references a helper that does not exist.');
|
|
2037
|
+
}
|
|
2038
|
+
if (!manifestOutcome.wrote && manifestOutcome.restoreFailure === null) {
|
|
1976
2039
|
warnings.push('the registry no longer carries this install\u2019s entries — a concurrent remover won the window between the ' +
|
|
1977
2040
|
'registry transaction and the manifest write, so NO manifest was written (a manifest describing entries that are ' +
|
|
1978
2041
|
'not there is what `--remove` would later act on). Re-run the install if you want the hooks back.');
|
|
1979
2042
|
}
|
|
1980
|
-
const drift = manifestOutcome.drift;
|
|
2043
|
+
const drift = manifestOutcome.restoreFailure !== null ? manifestOutcome.restoreFailure.drift : manifestOutcome.drift;
|
|
1981
2044
|
const installed = drift.installed;
|
|
1982
2045
|
const armedState = installed && executable && trustResult.trust === 'trusted';
|
|
1983
2046
|
// The install is not finished when the file is written — it is finished when the guard has been
|
|
@@ -2179,13 +2242,76 @@ function atomicWrite(path, text) {
|
|
|
2179
2242
|
renameSync(tmp, path);
|
|
2180
2243
|
}
|
|
2181
2244
|
/** 0600: the helpers are invoked as `node <path>`, never executed directly (AM-35c). */
|
|
2182
|
-
function writeHelperIfChanged(path, body, writes) {
|
|
2245
|
+
function writeHelperIfChanged(path, body, writes, write = atomicWrite) {
|
|
2183
2246
|
const current = existsSync(path) ? readFileSync(path, 'utf8') : undefined;
|
|
2184
2247
|
if (current === body)
|
|
2185
2248
|
return; // byte-idempotence: no change ⇒ no write ⇒ trust survives (FR-2)
|
|
2186
|
-
|
|
2249
|
+
write(path, body);
|
|
2187
2250
|
writes.push(path);
|
|
2188
2251
|
}
|
|
2252
|
+
/**
|
|
2253
|
+
* Handlers in a registry that reference the dz helper files (codex-hooks-remove-never-orphans).
|
|
2254
|
+
* Counted per HANDLER, over every surviving entry — so a foreign-looking handler salvaged from an
|
|
2255
|
+
* attributed matcher group still counts as a reference.
|
|
2256
|
+
*/
|
|
2257
|
+
function dzHelperReferences(registry) {
|
|
2258
|
+
let n = 0;
|
|
2259
|
+
for (const list of Object.values(registry.hooks)) {
|
|
2260
|
+
for (const entry of list) {
|
|
2261
|
+
const e = entry;
|
|
2262
|
+
const handlers = Array.isArray(e?.hooks) ? e.hooks : [entry];
|
|
2263
|
+
for (const h of handlers)
|
|
2264
|
+
if (looksLikeDzEntry(h))
|
|
2265
|
+
n += 1;
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
return n;
|
|
2269
|
+
}
|
|
2270
|
+
/**
|
|
2271
|
+
* Section-2 fail-closed path: remove exactly the entries THIS run emitted (attributed by the hashes
|
|
2272
|
+
* in the manifest it was about to write) and any stale manifest, under the caller's lock.
|
|
2273
|
+
*/
|
|
2274
|
+
function rollBackOwnEntries(paths, entries, registryText, manifestText, backupStamp, writes, cause) {
|
|
2275
|
+
const ours = parseCodexHookManifest(manifestText);
|
|
2276
|
+
const planned = removeCodexHooks(registryText, ours);
|
|
2277
|
+
let rolledBack = false;
|
|
2278
|
+
let rollbackError = null;
|
|
2279
|
+
let finalText = registryText;
|
|
2280
|
+
if (!planned.ok) {
|
|
2281
|
+
rollbackError = planned.error;
|
|
2282
|
+
}
|
|
2283
|
+
else {
|
|
2284
|
+
try {
|
|
2285
|
+
if (planned.result.changed) {
|
|
2286
|
+
backupRegistry(paths, registryText, backupStamp, writes);
|
|
2287
|
+
atomicWrite(paths.registry, planned.result.text);
|
|
2288
|
+
writes.push(paths.registry);
|
|
2289
|
+
}
|
|
2290
|
+
finalText = planned.result.text;
|
|
2291
|
+
rolledBack = true;
|
|
2292
|
+
}
|
|
2293
|
+
catch (err) {
|
|
2294
|
+
rollbackError = String(err?.message ?? err);
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
// A stale manifest from an earlier install would now describe entries that are gone.
|
|
2298
|
+
try {
|
|
2299
|
+
rmSync(paths.manifest, { force: true });
|
|
2300
|
+
}
|
|
2301
|
+
catch { /* the helper dir may itself be the obstacle (a file) — nothing to describe there */ }
|
|
2302
|
+
// Named, never pruned (AM-6, review r3): a handler this run did not write is left untouched even if
|
|
2303
|
+
// it references a missing helper. Deciding "does this shell command execute our helper?" needs a
|
|
2304
|
+
// shell parser; a substring match misfired BOTH ways (removed a valid foreign guard that merely
|
|
2305
|
+
// mentioned the path; missed an escaped path). Detection is `--check`'s job.
|
|
2306
|
+
const missing = [paths.vetoHelper, paths.recallHelper].filter((p) => !existsSync(p));
|
|
2307
|
+
return {
|
|
2308
|
+
cause,
|
|
2309
|
+
rolledBack,
|
|
2310
|
+
rollbackError,
|
|
2311
|
+
missing,
|
|
2312
|
+
drift: diffCodexHooks(finalText, entries, undefined),
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2189
2315
|
function backupRegistry(paths, currentText, now, writes) {
|
|
2190
2316
|
if (currentText === undefined)
|
|
2191
2317
|
return;
|