@dzhechkov/harness-core 0.7.5 → 0.7.7
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 +47 -27
- package/README.md +38 -1
- package/dist/feature-adr-routing.d.ts.map +1 -1
- package/dist/feature-adr-routing.js +6 -1
- package/dist/feature-adr-routing.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/provenance.d.ts +6 -0
- package/dist/provenance.d.ts.map +1 -1
- package/dist/provenance.js +22 -1
- package/dist/provenance.js.map +1 -1
- package/dist/skill-drift.d.ts +8 -2
- package/dist/skill-drift.d.ts.map +1 -1
- package/dist/skill-drift.js +60 -11
- package/dist/skill-drift.js.map +1 -1
- package/dist/skill-install-roots.d.ts +100 -0
- package/dist/skill-install-roots.d.ts.map +1 -0
- package/dist/skill-install-roots.js +116 -0
- package/dist/skill-install-roots.js.map +1 -0
- package/dist/tg-post.d.ts +22 -0
- package/dist/tg-post.d.ts.map +1 -1
- package/dist/tg-post.js +42 -1
- package/dist/tg-post.js.map +1 -1
- package/package.json +6 -6
- package/sbom.json +76 -26
- package/src/feature-adr-routing.ts +6 -1
- package/src/index.ts +1 -0
- package/src/provenance.ts +23 -1
- package/src/skill-drift.ts +70 -13
- package/src/skill-install-roots.ts +119 -0
- package/src/tg-post.ts +56 -1
package/dist/skill-drift.js
CHANGED
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
* @packageDocumentation
|
|
21
21
|
*/
|
|
22
22
|
import { readdirSync, statSync, readFileSync, writeFileSync, mkdirSync, rmSync, existsSync } from 'node:fs';
|
|
23
|
-
import { join, relative, resolve, dirname, basename } from 'node:path';
|
|
23
|
+
import { join, relative, resolve, dirname, basename, sep } from 'node:path';
|
|
24
24
|
import { createHash } from 'node:crypto';
|
|
25
|
+
import { DEV_SKILL_ROOT, SKILL_INSTALL_ROOTS, TARGET_ENRICHMENT_ASSETS } from './skill-install-roots.js';
|
|
25
26
|
const SKILL_MANIFEST = 'SKILL.md';
|
|
26
27
|
const IGNORED_ENTRIES = new Set(['node_modules', '__pycache__', '.DS_Store', 'run-history.json']);
|
|
27
28
|
/** md5 of a file's bytes (identical to both prototype scripts ⇒ identical drift verdicts). */
|
|
@@ -59,11 +60,43 @@ function walk(dir) {
|
|
|
59
60
|
* so BOTH the CI sweep AND the canonical-free `sync-canonical --check` share one implementation and
|
|
60
61
|
* yield the same verdict. Behavior-preserving refactor — no numbers change.
|
|
61
62
|
*/
|
|
63
|
+
/**
|
|
64
|
+
* Is this skill-dir-relative path a TARGET ENRICHMENT asset ({@link TARGET_ENRICHMENT_ASSETS})?
|
|
65
|
+
*
|
|
66
|
+
* Such a file exists in ONE copy by design — `dz init --enrich` writes it into the install tree and
|
|
67
|
+
* the canonical never has it. Counting it as drift makes the gate unsatisfiable; removing it during
|
|
68
|
+
* a heal destroys valid output. Compared with POSIX separators so a Windows `relative()` still matches.
|
|
69
|
+
*/
|
|
70
|
+
function isEnrichmentAsset(rel, copyDir) {
|
|
71
|
+
const owner = TARGET_ENRICHMENT_ASSETS[rel.split(sep).join('/')];
|
|
72
|
+
if (owner === undefined)
|
|
73
|
+
return false;
|
|
74
|
+
// The exemption is only valid inside the root that OWNS the asset. Elsewhere the same filename is
|
|
75
|
+
// a misplaced extra file, and waving it through would make the sweep report clean while the healer
|
|
76
|
+
// preserved it. ANCHORED at the skill dir, not searched across the whole absolute path: a repo that
|
|
77
|
+
// itself lives under a directory containing `/.agents/skills/` would otherwise have every copy in
|
|
78
|
+
// it — packages included — classified as codex-owned (cross-family review, 2026-08-25).
|
|
79
|
+
const posix = copyDir.split(sep).join('/');
|
|
80
|
+
return posix.endsWith('/' + owner + '/' + posix.split('/').slice(-1)[0]);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The canonical's own file list, with every enrichment-asset NAME removed regardless of where the
|
|
84
|
+
* canonical came from. A canonical picked by `--auto` (or handed in with `--from`) can itself be an
|
|
85
|
+
* enriched install copy; propagating its target-specific metadata into the package and other target
|
|
86
|
+
* copies is never correct, and the exemption above would then stop it ever being cleaned up.
|
|
87
|
+
*/
|
|
88
|
+
function withoutEnrichmentNames(rels) {
|
|
89
|
+
return rels.filter((r) => TARGET_ENRICHMENT_ASSETS[r.split(sep).join('/')] === undefined);
|
|
90
|
+
}
|
|
62
91
|
function comparePeers(copies) {
|
|
63
92
|
const relFiles = new Set();
|
|
64
93
|
for (const c of copies)
|
|
65
|
-
for (const f of walk(c))
|
|
66
|
-
|
|
94
|
+
for (const f of walk(c)) {
|
|
95
|
+
const rel = relative(c, f);
|
|
96
|
+
if (isEnrichmentAsset(rel, c))
|
|
97
|
+
continue;
|
|
98
|
+
relFiles.add(rel);
|
|
99
|
+
}
|
|
67
100
|
let driftFiles = 0;
|
|
68
101
|
let missingFiles = 0;
|
|
69
102
|
for (const rel of relFiles) {
|
|
@@ -89,7 +122,10 @@ function comparePeers(copies) {
|
|
|
89
122
|
* hence it is only ever reached behind an explicit `--auto` opt-in plus a loud warning.
|
|
90
123
|
*/
|
|
91
124
|
function pickMostComplete(copies) {
|
|
92
|
-
|
|
125
|
+
// Enrichment assets do not make a copy more COMPLETE — they make it a target install. Counting
|
|
126
|
+
// them would let an enriched copy win the heuristic on files no other copy is supposed to have.
|
|
127
|
+
const size = (d) => withoutEnrichmentNames(walk(d).map((p) => relative(d, p))).length;
|
|
128
|
+
return [...copies].sort().reduce((best, c) => (size(c) > size(best) ? c : best));
|
|
93
129
|
}
|
|
94
130
|
/**
|
|
95
131
|
* Resolve WHICH dir is canonical for a sync/check run, and HOW it resolved. Precedence is identical
|
|
@@ -111,12 +147,24 @@ function resolveCanonical(root, skill, copies, opts) {
|
|
|
111
147
|
return { canonical: null, resolvedFrom: 'none' };
|
|
112
148
|
}
|
|
113
149
|
/**
|
|
114
|
-
* Every skill dir (a dir containing `SKILL.md`) under `packages/` +
|
|
115
|
-
* `node_modules` / `__pycache__`.
|
|
150
|
+
* Every skill dir (a dir containing `SKILL.md`) under `packages/` + every per-target install root
|
|
151
|
+
* in {@link SKILL_INSTALL_ROOTS}, excluding `node_modules` / `__pycache__`. Originally ported from
|
|
152
|
+
* `scripts/drift-sweep-skills.mjs`, which searched `.claude/skills` alone — see ADR-001
|
|
153
|
+
* (skill-copy-discovery) for why one hardcoded root let the Codex install drift unseen.
|
|
116
154
|
*/
|
|
117
155
|
function findSkillDirs(root, scope = 'all') {
|
|
118
156
|
const dirs = [];
|
|
119
|
-
|
|
157
|
+
// Roots are ANCHORED at the repo root — never a recursive search for `*/skills`. A stale agent
|
|
158
|
+
// worktree under `.claude/worktrees/<id>/` holds a full second copy of `packages/`,
|
|
159
|
+
// `.claude/skills` AND `.agents/skills`; a recursive sweep would report every skill in the repo
|
|
160
|
+
// as drifting against a checkout nobody maintains, and the healer would be entitled to WRITE
|
|
161
|
+
// into it (ADR-001, Option C rejected on exactly this measurement).
|
|
162
|
+
const installRoots = scope === 'installs'
|
|
163
|
+
? SKILL_INSTALL_ROOTS.filter((r) => r !== DEV_SKILL_ROOT)
|
|
164
|
+
: SKILL_INSTALL_ROOTS;
|
|
165
|
+
const roots = scope === 'packages'
|
|
166
|
+
? [join(root, 'packages')]
|
|
167
|
+
: [join(root, 'packages'), ...installRoots.map((r) => join(root, ...r.split('/')))];
|
|
120
168
|
const stack = roots.filter((p) => existsSync(p));
|
|
121
169
|
while (stack.length) {
|
|
122
170
|
const d = stack.pop();
|
|
@@ -231,16 +279,17 @@ export function syncCanonicalSkill(root, skill, opts = {}) {
|
|
|
231
279
|
// Bare WRITE with no resolvable canonical → REFUSE. Mutates nothing (`wrote:[]` proves it).
|
|
232
280
|
return { canonical: '', canonicalExists: false, resolvedFrom, copies: allCopies.length, synced: 0, drifted: 0, wrote: [] };
|
|
233
281
|
}
|
|
234
|
-
const canonFiles = walk(canonical)
|
|
235
|
-
.map((p) => relative(canonical, p))
|
|
236
|
-
.sort();
|
|
282
|
+
const canonFiles = withoutEnrichmentNames(walk(canonical).map((p) => relative(canonical, p))).sort();
|
|
237
283
|
// Every <skill>/ dir except the canonical itself.
|
|
238
284
|
const copies = allCopies.filter((d) => relative(canonical, d) !== '');
|
|
239
285
|
let drifted = 0;
|
|
240
286
|
let synced = 0;
|
|
241
287
|
const wrote = [];
|
|
242
288
|
for (const copy of copies) {
|
|
243
|
-
|
|
289
|
+
// Target ENRICHMENT assets are excluded from the copy's file set entirely: they exist in the
|
|
290
|
+
// install tree by design, the canonical never has them, and both the drift verdict and the
|
|
291
|
+
// removal pass below must leave them alone.
|
|
292
|
+
const copyFiles = new Set(walk(copy).map((p) => relative(copy, p)).filter((f) => !isEnrichmentAsset(f, copy)));
|
|
244
293
|
let differs = false;
|
|
245
294
|
// Extra files in the copy not present in canonical ⇒ drift.
|
|
246
295
|
for (const f of copyFiles)
|
package/dist/skill-drift.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-drift.js","sourceRoot":"","sources":["../src/skill-drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"skill-drift.js","sourceRoot":"","sources":["../src/skill-drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,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K,EAAE,CAAC;AAC3G,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where installed skill dirs live — the single source of truth for skill-copy DISCOVERY.
|
|
3
|
+
*
|
|
4
|
+
* The harness installs skills into a per-TARGET tree (`dz install --target <name>`). Five of the
|
|
5
|
+
* ten targets in {@link TARGET_NAMES} emit an agentskills.io-shaped directory containing a
|
|
6
|
+
* `SKILL.md`; the other five (copilot, cursor, windsurf, gemini, agents-md) emit rules/instructions
|
|
7
|
+
* FILES and therefore hold no skill dirs to keep in sync.
|
|
8
|
+
*
|
|
9
|
+
* | Target | Root | Adapter constant |
|
|
10
|
+
* |---|---|---|
|
|
11
|
+
* | `claude-code` | `.claude/skills` | — (the adapter exports no root constant) |
|
|
12
|
+
* | `codex` | `.agents/skills` | `CODEX_SKILLS_ROOT` |
|
|
13
|
+
* | `opencode` | `.opencode/skills` | `OPENCODE_SKILLS_ROOT` |
|
|
14
|
+
* | `hermes` | `.hermes/skills` | `HERMES_SKILLS_ROOT` |
|
|
15
|
+
* | `openclaude` | `.openclaude/skills` | `OPENCLAUDE_SKILLS_ROOT` |
|
|
16
|
+
*
|
|
17
|
+
* **Why this list is data with no imports.** `skill-drift.ts` — the drift detector behind the
|
|
18
|
+
* `no-skill-drift` HARD guard rule — is deliberately dependency-free (`node:fs`/`node:path`/
|
|
19
|
+
* `node:crypto`). `targets.ts`, which owns the adapter registry, imports all ten adapter packages;
|
|
20
|
+
* importing it from the drift sweep would drag ten packages into the guard's load path for a list
|
|
21
|
+
* of five strings. So the list lives here as data, and the link back to the adapters is asserted in
|
|
22
|
+
* `test/skill-install-roots.test.ts`, where importing them costs nothing.
|
|
23
|
+
*
|
|
24
|
+
* **Why this matters (the defect that produced it, MEASURED 2026-08-25).** `findSkillDirs` searched
|
|
25
|
+
* `packages/` + `.claude/skills` only. `.agents/skills/feature-adr` — the Codex install — drifted
|
|
26
|
+
* from the canonical for a day while `dz sync-canonical feature-adr --check` reported "all 3 copies
|
|
27
|
+
* match canonical" and the HARD guard passed. Two feature-adr gates were degraded in that copy: the
|
|
28
|
+
* K1 name-availability section was missing from `SKILL.md`, and the C6 amendment-integrity check
|
|
29
|
+
* was missing from the K2 script. A gate that cannot see a copy cannot gate it.
|
|
30
|
+
*
|
|
31
|
+
* **Honest limit.** A target whose adapter exports no root constant (today: `claude-code`) must be
|
|
32
|
+
* listed here by hand — the completeness test proves every EXPORTED constant is covered, and cannot
|
|
33
|
+
* prove a constant that does not exist is covered.
|
|
34
|
+
*
|
|
35
|
+
* @packageDocumentation
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Files a TARGET legitimately adds INSIDE an installed skill dir — enrichment, not drift.
|
|
39
|
+
*
|
|
40
|
+
* `dz init --enrich` / `dz setup --enrich` write per-target metadata into the skill dir itself
|
|
41
|
+
* (`operations.ts`): codex gets `<skillDir>/agents/openai.yaml` (UI metadata + risk scoring),
|
|
42
|
+
* hermes gets `<skillDir>/hermes-config.yaml`. OpenCode's enrichment lands in
|
|
43
|
+
* `.opencode/agents/<id>.md`, OUTSIDE any skill dir, so it needs no entry here.
|
|
44
|
+
*
|
|
45
|
+
* These paths must be invisible to the drift comparison and untouchable by the healer. Without the
|
|
46
|
+
* exemption, widening discovery to install roots would (a) report permanent, unfixable drift on any
|
|
47
|
+
* enriched install — making the HARD gate unsatisfiable — and (b) worse, let `dz sync-canonical`
|
|
48
|
+
* DELETE the enrichment, because the heal removes every file the canonical does not have. Found by
|
|
49
|
+
* cross-family review (Codex `gpt-5.6-sol`, 2026-08-25) on a latent defect: this repo's own
|
|
50
|
+
* `.agents/` install was never enriched, so no test and no live run would have shown it.
|
|
51
|
+
*
|
|
52
|
+
* Each asset is mapped to the install root that OWNS it, because the exemption must depend on WHERE
|
|
53
|
+
* the file sits, not only on its name: `agents/openai.yaml` under a package copy, or
|
|
54
|
+
* `hermes-config.yaml` outside the hermes root, is a misplaced file — waving it through would let
|
|
55
|
+
* the sweep report clean and the healer preserve it (second cross-family round, 2026-08-25).
|
|
56
|
+
*
|
|
57
|
+
* Keys are relative to the skill dir root and POSIX-separated; values are repo-root-relative install
|
|
58
|
+
* roots from {@link SKILL_INSTALL_ROOT_BY_TARGET}.
|
|
59
|
+
*/
|
|
60
|
+
export declare const TARGET_ENRICHMENT_ASSETS: Readonly<Record<string, string>>;
|
|
61
|
+
/**
|
|
62
|
+
* The one install root that is ALSO the repo's hand-edited development tree.
|
|
63
|
+
*
|
|
64
|
+
* `.claude/skills` is where this repo's own skills are authored before they are synced into
|
|
65
|
+
* `packages/`, so it legitimately LAGS the published copies — MEASURED 2026-08-25, `dz drift-check
|
|
66
|
+
* --all` reports three skills drifting for exactly that reason (`decision-mockups` 12/22 files,
|
|
67
|
+
* `idea2prd-manual` 3/11, `observability` 1/5). A byte-identity GATE that included it would be
|
|
68
|
+
* red-on-arrival, which is why `scope: 'packages'` exists at all.
|
|
69
|
+
*
|
|
70
|
+
* Every OTHER root in {@link SKILL_INSTALL_ROOTS} is machine-generated by `dz install --target …`
|
|
71
|
+
* and has no licence to lag: a stale generated copy is the defect this module was written for.
|
|
72
|
+
* That asymmetry is what `scope: 'installs'` encodes.
|
|
73
|
+
*/
|
|
74
|
+
export declare const DEV_SKILL_ROOT = ".claude/skills";
|
|
75
|
+
/**
|
|
76
|
+
* Every `--target` name → the repo-root-relative dir into which it installs `SKILL.md`-bearing
|
|
77
|
+
* skill dirs, or `null` for a target that emits rules/instructions FILES and therefore holds no
|
|
78
|
+
* skill dirs to keep in sync.
|
|
79
|
+
*
|
|
80
|
+
* **This map, not the derived list, is the thing a new target must touch.** Its keys are asserted
|
|
81
|
+
* against `TARGET_NAMES` in `test/skill-install-roots.test.ts`, so adding target #11 turns that
|
|
82
|
+
* test RED until someone states whether it installs skill dirs — which is exactly the question
|
|
83
|
+
* nobody was asked when `codex` was added and its install tree went ungated. A test that
|
|
84
|
+
* hand-enumerated the adapter constants would have stayed green through that (raised by
|
|
85
|
+
* cross-family review, Codex `gpt-5.6-sol`, 2026-08-25).
|
|
86
|
+
*
|
|
87
|
+
* Kept as a literal with NO imports: `skill-drift.ts` consumes it and is documented dependency-free,
|
|
88
|
+
* while `targets.ts` — which owns the adapter registry — pulls in all ten adapter packages.
|
|
89
|
+
*/
|
|
90
|
+
export declare const SKILL_INSTALL_ROOT_BY_TARGET: Readonly<Record<string, string | null>>;
|
|
91
|
+
/**
|
|
92
|
+
* Repo-root-relative directories that hold installed `SKILL.md`-bearing skill dirs — DERIVED from
|
|
93
|
+
* {@link SKILL_INSTALL_ROOT_BY_TARGET} so the two can never disagree. POSIX separators; consumers
|
|
94
|
+
* `join()` them onto the repo root themselves.
|
|
95
|
+
*
|
|
96
|
+
* Consumed by `findSkillDirs` (`skill-drift.ts`). A root that does not exist, or exists without any
|
|
97
|
+
* `SKILL.md`, contributes nothing — so listing a root the current repo does not use is inert.
|
|
98
|
+
*/
|
|
99
|
+
export declare const SKILL_INSTALL_ROOTS: readonly string[];
|
|
100
|
+
//# sourceMappingURL=skill-install-roots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-install-roots.d.ts","sourceRoot":"","sources":["../src/skill-install-roots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGrE,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAYhF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EACR,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where installed skill dirs live — the single source of truth for skill-copy DISCOVERY.
|
|
3
|
+
*
|
|
4
|
+
* The harness installs skills into a per-TARGET tree (`dz install --target <name>`). Five of the
|
|
5
|
+
* ten targets in {@link TARGET_NAMES} emit an agentskills.io-shaped directory containing a
|
|
6
|
+
* `SKILL.md`; the other five (copilot, cursor, windsurf, gemini, agents-md) emit rules/instructions
|
|
7
|
+
* FILES and therefore hold no skill dirs to keep in sync.
|
|
8
|
+
*
|
|
9
|
+
* | Target | Root | Adapter constant |
|
|
10
|
+
* |---|---|---|
|
|
11
|
+
* | `claude-code` | `.claude/skills` | — (the adapter exports no root constant) |
|
|
12
|
+
* | `codex` | `.agents/skills` | `CODEX_SKILLS_ROOT` |
|
|
13
|
+
* | `opencode` | `.opencode/skills` | `OPENCODE_SKILLS_ROOT` |
|
|
14
|
+
* | `hermes` | `.hermes/skills` | `HERMES_SKILLS_ROOT` |
|
|
15
|
+
* | `openclaude` | `.openclaude/skills` | `OPENCLAUDE_SKILLS_ROOT` |
|
|
16
|
+
*
|
|
17
|
+
* **Why this list is data with no imports.** `skill-drift.ts` — the drift detector behind the
|
|
18
|
+
* `no-skill-drift` HARD guard rule — is deliberately dependency-free (`node:fs`/`node:path`/
|
|
19
|
+
* `node:crypto`). `targets.ts`, which owns the adapter registry, imports all ten adapter packages;
|
|
20
|
+
* importing it from the drift sweep would drag ten packages into the guard's load path for a list
|
|
21
|
+
* of five strings. So the list lives here as data, and the link back to the adapters is asserted in
|
|
22
|
+
* `test/skill-install-roots.test.ts`, where importing them costs nothing.
|
|
23
|
+
*
|
|
24
|
+
* **Why this matters (the defect that produced it, MEASURED 2026-08-25).** `findSkillDirs` searched
|
|
25
|
+
* `packages/` + `.claude/skills` only. `.agents/skills/feature-adr` — the Codex install — drifted
|
|
26
|
+
* from the canonical for a day while `dz sync-canonical feature-adr --check` reported "all 3 copies
|
|
27
|
+
* match canonical" and the HARD guard passed. Two feature-adr gates were degraded in that copy: the
|
|
28
|
+
* K1 name-availability section was missing from `SKILL.md`, and the C6 amendment-integrity check
|
|
29
|
+
* was missing from the K2 script. A gate that cannot see a copy cannot gate it.
|
|
30
|
+
*
|
|
31
|
+
* **Honest limit.** A target whose adapter exports no root constant (today: `claude-code`) must be
|
|
32
|
+
* listed here by hand — the completeness test proves every EXPORTED constant is covered, and cannot
|
|
33
|
+
* prove a constant that does not exist is covered.
|
|
34
|
+
*
|
|
35
|
+
* @packageDocumentation
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Files a TARGET legitimately adds INSIDE an installed skill dir — enrichment, not drift.
|
|
39
|
+
*
|
|
40
|
+
* `dz init --enrich` / `dz setup --enrich` write per-target metadata into the skill dir itself
|
|
41
|
+
* (`operations.ts`): codex gets `<skillDir>/agents/openai.yaml` (UI metadata + risk scoring),
|
|
42
|
+
* hermes gets `<skillDir>/hermes-config.yaml`. OpenCode's enrichment lands in
|
|
43
|
+
* `.opencode/agents/<id>.md`, OUTSIDE any skill dir, so it needs no entry here.
|
|
44
|
+
*
|
|
45
|
+
* These paths must be invisible to the drift comparison and untouchable by the healer. Without the
|
|
46
|
+
* exemption, widening discovery to install roots would (a) report permanent, unfixable drift on any
|
|
47
|
+
* enriched install — making the HARD gate unsatisfiable — and (b) worse, let `dz sync-canonical`
|
|
48
|
+
* DELETE the enrichment, because the heal removes every file the canonical does not have. Found by
|
|
49
|
+
* cross-family review (Codex `gpt-5.6-sol`, 2026-08-25) on a latent defect: this repo's own
|
|
50
|
+
* `.agents/` install was never enriched, so no test and no live run would have shown it.
|
|
51
|
+
*
|
|
52
|
+
* Each asset is mapped to the install root that OWNS it, because the exemption must depend on WHERE
|
|
53
|
+
* the file sits, not only on its name: `agents/openai.yaml` under a package copy, or
|
|
54
|
+
* `hermes-config.yaml` outside the hermes root, is a misplaced file — waving it through would let
|
|
55
|
+
* the sweep report clean and the healer preserve it (second cross-family round, 2026-08-25).
|
|
56
|
+
*
|
|
57
|
+
* Keys are relative to the skill dir root and POSIX-separated; values are repo-root-relative install
|
|
58
|
+
* roots from {@link SKILL_INSTALL_ROOT_BY_TARGET}.
|
|
59
|
+
*/
|
|
60
|
+
export const TARGET_ENRICHMENT_ASSETS = {
|
|
61
|
+
'agents/openai.yaml': '.agents/skills',
|
|
62
|
+
'hermes-config.yaml': '.hermes/skills',
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The one install root that is ALSO the repo's hand-edited development tree.
|
|
66
|
+
*
|
|
67
|
+
* `.claude/skills` is where this repo's own skills are authored before they are synced into
|
|
68
|
+
* `packages/`, so it legitimately LAGS the published copies — MEASURED 2026-08-25, `dz drift-check
|
|
69
|
+
* --all` reports three skills drifting for exactly that reason (`decision-mockups` 12/22 files,
|
|
70
|
+
* `idea2prd-manual` 3/11, `observability` 1/5). A byte-identity GATE that included it would be
|
|
71
|
+
* red-on-arrival, which is why `scope: 'packages'` exists at all.
|
|
72
|
+
*
|
|
73
|
+
* Every OTHER root in {@link SKILL_INSTALL_ROOTS} is machine-generated by `dz install --target …`
|
|
74
|
+
* and has no licence to lag: a stale generated copy is the defect this module was written for.
|
|
75
|
+
* That asymmetry is what `scope: 'installs'` encodes.
|
|
76
|
+
*/
|
|
77
|
+
export const DEV_SKILL_ROOT = '.claude/skills';
|
|
78
|
+
/**
|
|
79
|
+
* Every `--target` name → the repo-root-relative dir into which it installs `SKILL.md`-bearing
|
|
80
|
+
* skill dirs, or `null` for a target that emits rules/instructions FILES and therefore holds no
|
|
81
|
+
* skill dirs to keep in sync.
|
|
82
|
+
*
|
|
83
|
+
* **This map, not the derived list, is the thing a new target must touch.** Its keys are asserted
|
|
84
|
+
* against `TARGET_NAMES` in `test/skill-install-roots.test.ts`, so adding target #11 turns that
|
|
85
|
+
* test RED until someone states whether it installs skill dirs — which is exactly the question
|
|
86
|
+
* nobody was asked when `codex` was added and its install tree went ungated. A test that
|
|
87
|
+
* hand-enumerated the adapter constants would have stayed green through that (raised by
|
|
88
|
+
* cross-family review, Codex `gpt-5.6-sol`, 2026-08-25).
|
|
89
|
+
*
|
|
90
|
+
* Kept as a literal with NO imports: `skill-drift.ts` consumes it and is documented dependency-free,
|
|
91
|
+
* while `targets.ts` — which owns the adapter registry — pulls in all ten adapter packages.
|
|
92
|
+
*/
|
|
93
|
+
export const SKILL_INSTALL_ROOT_BY_TARGET = {
|
|
94
|
+
'claude-code': '.claude/skills',
|
|
95
|
+
codex: '.agents/skills',
|
|
96
|
+
opencode: '.opencode/skills',
|
|
97
|
+
hermes: '.hermes/skills',
|
|
98
|
+
openclaude: '.openclaude/skills',
|
|
99
|
+
// Rules/instructions FILE targets — no skill dirs, nothing to compare.
|
|
100
|
+
copilot: null,
|
|
101
|
+
'agents-md': null,
|
|
102
|
+
cursor: null,
|
|
103
|
+
gemini: null,
|
|
104
|
+
windsurf: null,
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Repo-root-relative directories that hold installed `SKILL.md`-bearing skill dirs — DERIVED from
|
|
108
|
+
* {@link SKILL_INSTALL_ROOT_BY_TARGET} so the two can never disagree. POSIX separators; consumers
|
|
109
|
+
* `join()` them onto the repo root themselves.
|
|
110
|
+
*
|
|
111
|
+
* Consumed by `findSkillDirs` (`skill-drift.ts`). A root that does not exist, or exists without any
|
|
112
|
+
* `SKILL.md`, contributes nothing — so listing a root the current repo does not use is inert.
|
|
113
|
+
*/
|
|
114
|
+
export const SKILL_INSTALL_ROOTS = Object.values(SKILL_INSTALL_ROOT_BY_TARGET)
|
|
115
|
+
.filter((r) => r !== null);
|
|
116
|
+
//# sourceMappingURL=skill-install-roots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-install-roots.js","sourceRoot":"","sources":["../src/skill-install-roots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAqC;IACxE,oBAAoB,EAAE,gBAAgB;IACtC,oBAAoB,EAAE,gBAAgB;CACvC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAA4C;IACnF,aAAa,EAAE,gBAAgB;IAC/B,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,gBAAgB;IACxB,UAAU,EAAE,oBAAoB;IAChC,uEAAuE;IACvE,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB,MAAM,CAAC,MAAM,CAAC,4BAA4B,CAAC;KAC9F,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC"}
|
package/dist/tg-post.d.ts
CHANGED
|
@@ -44,11 +44,33 @@ export interface TgSendDecision {
|
|
|
44
44
|
* intention; without it the refusal names the local MSK time it computed, so the operator can check
|
|
45
45
|
* the arithmetic instead of trusting it.
|
|
46
46
|
*/
|
|
47
|
+
/**
|
|
48
|
+
* The dedup key for a post: sha256 of its VISIBLE text (markup stripped). Two drafts that render
|
|
49
|
+
* identically in Telegram are the same post even if their HTML differs by a whitespace — the key
|
|
50
|
+
* must be about what the reader sees, not the bytes (G5, ADR-005).
|
|
51
|
+
*/
|
|
52
|
+
export declare function tgVisibleSha256(html: string): string;
|
|
53
|
+
/** One recorded send. sha256 is the visible-text key; ts is ISO. */
|
|
54
|
+
/** One journal line. status: 'pending' written BEFORE the send (crash-window guard), 'sent' after
|
|
55
|
+
* Telegram accepts. A legacy line with no status is treated as 'sent'. */
|
|
56
|
+
export interface TgSentRecord {
|
|
57
|
+
readonly sha256: string;
|
|
58
|
+
readonly ts: string;
|
|
59
|
+
readonly status?: 'pending' | 'sent';
|
|
60
|
+
}
|
|
47
61
|
export declare function decideTgSend(input: {
|
|
48
62
|
readonly issues: readonly TgHtmlIssue[];
|
|
49
63
|
readonly provenanceOutcome: 'allowed' | 'blocked' | 'not-established' | 'skipped';
|
|
50
64
|
readonly confirmed: boolean;
|
|
51
65
|
readonly nowUtcIso: string;
|
|
52
66
|
readonly nightOverride: boolean;
|
|
67
|
+
/** G6 stop-cord: a `.dz/tg-post/HALT` file exists. Checked FIRST, before anything else. */
|
|
68
|
+
readonly halted?: boolean;
|
|
69
|
+
/** sha256 of THIS post's visible text (tgVisibleSha256) — the G5 dedup key. */
|
|
70
|
+
readonly sha256?: string;
|
|
71
|
+
/** The send journal as FACTS (the pure half never reads a file). Undefined ⇒ log unreadable. */
|
|
72
|
+
readonly sentLog?: readonly TgSentRecord[] | undefined;
|
|
73
|
+
/** G4 ceiling; default 10 (ADR-003). Sends in the trailing 24h are counted against it. */
|
|
74
|
+
readonly maxPostsPerDay?: number;
|
|
53
75
|
}): TgSendDecision;
|
|
54
76
|
//# sourceMappingURL=tg-post.d.ts.map
|
package/dist/tg-post.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tg-post.d.ts","sourceRoot":"","sources":["../src/tg-post.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tg-post.d.ts","sourceRoot":"","sources":["../src/tg-post.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AAEH,wFAAwF;AACxF,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAG5C,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,gBAAgB,GAAG,YAAY,GAAG,YA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cAAc,CAAC,EAAE,MAAM,CAAC;CAClC,GAAG,cAAc,CAwDjB"}
|
package/dist/tg-post.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
1
2
|
/**
|
|
2
3
|
* `dz tg-post` — the pure half: validate an approved draft against what Telegram will accept and
|
|
3
4
|
* what the channel's own accepted design demands.
|
|
@@ -88,7 +89,21 @@ export function tgPostHtmlIssues(html) {
|
|
|
88
89
|
* intention; without it the refusal names the local MSK time it computed, so the operator can check
|
|
89
90
|
* the arithmetic instead of trusting it.
|
|
90
91
|
*/
|
|
92
|
+
/**
|
|
93
|
+
* The dedup key for a post: sha256 of its VISIBLE text (markup stripped). Two drafts that render
|
|
94
|
+
* identically in Telegram are the same post even if their HTML differs by a whitespace — the key
|
|
95
|
+
* must be about what the reader sees, not the bytes (G5, ADR-005).
|
|
96
|
+
*/
|
|
97
|
+
export function tgVisibleSha256(html) {
|
|
98
|
+
const visible = html.replace(/<[^>]*>/g, '').replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
|
|
99
|
+
return createHash('sha256').update(visible.trim(), 'utf-8').digest('hex');
|
|
100
|
+
}
|
|
91
101
|
export function decideTgSend(input) {
|
|
102
|
+
// G6 (ADR-001 fail-closed-guard-order): the stop-cord is ABSOLUTE and FIRST — it halts even a
|
|
103
|
+
// perfect post, before any cheaper check, so no bug in a later gate can route around it.
|
|
104
|
+
if (input.halted === true) {
|
|
105
|
+
return { action: 'refuse', reason: 'STOP-CORD engaged (.dz/tg-post/HALT exists) — nothing is published while it is present; remove the file to resume' };
|
|
106
|
+
}
|
|
92
107
|
if (input.issues.length > 0) {
|
|
93
108
|
return { action: 'refuse', reason: `${input.issues.length} formatting issue(s) — Telegram would refuse or mangle this draft` };
|
|
94
109
|
}
|
|
@@ -112,6 +127,32 @@ export function decideTgSend(input) {
|
|
|
112
127
|
return { action: 'refuse', reason: `it is ${String(mskHour).padStart(2, '0')}:xx MSK — the channel posts nothing between 00:00 and 06:00 MSK (ADR-003). Pass --night if this is deliberate` };
|
|
113
128
|
}
|
|
114
129
|
}
|
|
115
|
-
|
|
130
|
+
// G4/G5 need the journal. An UNREADABLE journal (sentLog undefined) is fail-closed: an unreadable
|
|
131
|
+
// limit counter does not prove the limit is unreached (Step-0 recall — never invert fail-closed on
|
|
132
|
+
// an absent/degraded input).
|
|
133
|
+
if (input.sentLog === undefined) {
|
|
134
|
+
return { action: 'refuse', reason: 'the send journal could not be read — an unreadable limit/dedup counter cannot show the ceiling is unreached; refusing (fail-closed)' };
|
|
135
|
+
}
|
|
136
|
+
// G5 dedup: this exact visible-text post already went out.
|
|
137
|
+
// G5 dedup covers BOTH a completed send AND an in-flight PENDING record of the same visible text
|
|
138
|
+
// (Codex A- two-phase): a pending row means a prior attempt reached the send path — do not
|
|
139
|
+
// double-publish. A stuck pending is surfaced (the CLI warns) and cleared by removing its line.
|
|
140
|
+
if (input.sha256 !== undefined && input.sentLog.some((r) => r.sha256 === input.sha256)) {
|
|
141
|
+
const prior = input.sentLog.find((r) => r.sha256 === input.sha256);
|
|
142
|
+
return { action: 'refuse', reason: (prior && prior.status === 'pending')
|
|
143
|
+
? 'a PENDING send of this exact post exists (a prior attempt reached the send path) — refusing to double-publish; if that attempt truly failed, remove its line from .dz/tg-post/sent-log.jsonl and retry'
|
|
144
|
+
: 'this exact post (by visible text) has already been sent — refusing a duplicate' };
|
|
145
|
+
}
|
|
146
|
+
// G4 daily limit: sends in the trailing 24h against the ceiling.
|
|
147
|
+
const nowMs = Date.parse(input.nowUtcIso);
|
|
148
|
+
const cutoff = Number.isFinite(nowMs) ? nowMs - 24 * 3600_000 : -Infinity;
|
|
149
|
+
// Only ACCEPTED sends count against the daily limit — a pending row may never have landed, so it
|
|
150
|
+
// must not eat the ceiling (mirror of 'record after'): status 'pending' is excluded, 'sent'/legacy counted.
|
|
151
|
+
const inWindow = input.sentLog.filter((r) => { const t = Date.parse(r.ts); return Number.isFinite(t) && t >= cutoff && r.status !== 'pending'; }).length;
|
|
152
|
+
const ceiling = typeof input.maxPostsPerDay === 'number' && input.maxPostsPerDay > 0 ? Math.floor(input.maxPostsPerDay) : 10;
|
|
153
|
+
if (inWindow >= ceiling) {
|
|
154
|
+
return { action: 'refuse', reason: `daily limit reached: ${inWindow} post(s) sent in the last 24h, ceiling ${ceiling} (ADR-003) — the channel does not exceed its own tempo` };
|
|
155
|
+
}
|
|
156
|
+
return { action: 'send', reason: 'stop-cord clear, formatted, provenance-cleared, confirmed, inside hours, not a duplicate, under the daily limit' };
|
|
116
157
|
}
|
|
117
158
|
//# sourceMappingURL=tg-post.js.map
|
package/dist/tg-post.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tg-post.js","sourceRoot":"","sources":["../src/tg-post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,wFAAwF;AACxF,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY;IACxE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY;CAC7C,CAAC;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAOlC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;AAChH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,MAAM,IAAI,GAA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,MAAM,CAAC;IACzJ,MAAM,OAAO,GAAG,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ,IAAI,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7H,IAAI,QAAQ,IAAI,OAAO,EAAE,CAAC;QACxB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,wBAAwB,QAAQ,0CAA0C,OAAO,wDAAwD,EAAE,CAAC;IACjL,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iHAAiH,EAAE,CAAC;AACvJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dzhechkov/harness-core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"description": "Shared harness logic - skill loading, additive apply, and the init/sync/verify/doctor operations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"proper-lockfile": "^4.1.2",
|
|
31
31
|
"yaml": "^2.0.0",
|
|
32
|
-
"@dzhechkov/adapter-claude": "^0.2.2",
|
|
33
32
|
"@dzhechkov/adapter-agents-md": "0.1.3",
|
|
34
33
|
"@dzhechkov/adapter-codex": "^0.2.2",
|
|
35
|
-
"@dzhechkov/adapter-cursor": "0.1.3",
|
|
36
34
|
"@dzhechkov/adapter-copilot": "0.1.3",
|
|
35
|
+
"@dzhechkov/adapter-claude": "^0.2.2",
|
|
36
|
+
"@dzhechkov/adapter-cursor": "0.1.3",
|
|
37
37
|
"@dzhechkov/adapter-gemini": "0.1.3",
|
|
38
38
|
"@dzhechkov/adapter-openclaude": "^0.1.2",
|
|
39
39
|
"@dzhechkov/adapter-opencode": "^0.2.2",
|
|
40
|
-
"@dzhechkov/adapter-hermes": "^0.2.2",
|
|
41
40
|
"@dzhechkov/adapter-windsurf": "0.1.3",
|
|
42
|
-
"@dzhechkov/
|
|
43
|
-
"@dzhechkov/
|
|
41
|
+
"@dzhechkov/memory": "0.2.15",
|
|
42
|
+
"@dzhechkov/adapter-hermes": "^0.2.2",
|
|
43
|
+
"@dzhechkov/core": "0.2.17"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"@ruvector/rvf": {
|