@dzhechkov/harness-core 0.8.6 → 0.8.11
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 +361 -97
- package/README.md +48 -1
- package/dist/amendment-trace.d.ts.map +1 -1
- package/dist/amendment-trace.js +12 -1
- package/dist/amendment-trace.js.map +1 -1
- package/dist/codex-invoke.d.ts +73 -0
- package/dist/codex-invoke.d.ts.map +1 -0
- package/dist/codex-invoke.js +80 -0
- package/dist/codex-invoke.js.map +1 -0
- package/dist/compounding.d.ts +54 -0
- package/dist/compounding.d.ts.map +1 -1
- package/dist/compounding.js +221 -1
- package/dist/compounding.js.map +1 -1
- package/dist/discrimination-gate.d.ts +63 -3
- package/dist/discrimination-gate.d.ts.map +1 -1
- package/dist/discrimination-gate.js +113 -16
- package/dist/discrimination-gate.js.map +1 -1
- package/dist/eta.d.ts +92 -0
- package/dist/eta.d.ts.map +1 -0
- package/dist/eta.js +488 -0
- package/dist/eta.js.map +1 -0
- package/dist/event-chain.d.ts +30 -0
- package/dist/event-chain.d.ts.map +1 -1
- package/dist/event-chain.js +24 -0
- package/dist/event-chain.js.map +1 -1
- package/dist/feature-adr-checkpoints.js +1 -1
- package/dist/feature-adr-decision-recall.d.ts +167 -0
- package/dist/feature-adr-decision-recall.d.ts.map +1 -0
- package/dist/feature-adr-decision-recall.js +519 -0
- package/dist/feature-adr-decision-recall.js.map +1 -0
- package/dist/feature-adr-landing.d.ts +37 -0
- package/dist/feature-adr-landing.d.ts.map +1 -0
- package/dist/feature-adr-landing.js +59 -0
- package/dist/feature-adr-landing.js.map +1 -0
- package/dist/feature-adr-routing.d.ts +2 -2
- package/dist/feature-adr-routing.d.ts.map +1 -1
- package/dist/feature-adr-routing.js +7 -11
- package/dist/feature-adr-routing.js.map +1 -1
- package/dist/guard-promotion.d.ts +41 -0
- package/dist/guard-promotion.d.ts.map +1 -1
- package/dist/guard-promotion.js +218 -4
- package/dist/guard-promotion.js.map +1 -1
- package/dist/guard-volume.d.ts +108 -0
- package/dist/guard-volume.d.ts.map +1 -0
- package/dist/guard-volume.js +536 -0
- package/dist/guard-volume.js.map +1 -0
- package/dist/guard.d.ts +17 -0
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +92 -4
- package/dist/guard.js.map +1 -1
- package/dist/index.d.ts +24 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/dist/integration-apply.d.ts +25 -0
- package/dist/integration-apply.d.ts.map +1 -0
- package/dist/integration-apply.js +299 -0
- package/dist/integration-apply.js.map +1 -0
- package/dist/integration-evidence.d.ts +46 -0
- package/dist/integration-evidence.d.ts.map +1 -0
- package/dist/integration-evidence.js +44 -0
- package/dist/integration-evidence.js.map +1 -0
- package/dist/integration-probe-worker.d.ts +22 -0
- package/dist/integration-probe-worker.d.ts.map +1 -0
- package/dist/integration-probe-worker.js +334 -0
- package/dist/integration-probe-worker.js.map +1 -0
- package/dist/integrations-verify.d.ts +60 -0
- package/dist/integrations-verify.d.ts.map +1 -0
- package/dist/integrations-verify.js +194 -0
- package/dist/integrations-verify.js.map +1 -0
- package/dist/lesson-generalization.d.ts +29 -0
- package/dist/lesson-generalization.d.ts.map +1 -0
- package/dist/lesson-generalization.js +84 -0
- package/dist/lesson-generalization.js.map +1 -0
- package/dist/mutation-gate.d.ts +39 -36
- package/dist/mutation-gate.d.ts.map +1 -1
- package/dist/mutation-gate.js +111 -5
- package/dist/mutation-gate.js.map +1 -1
- package/dist/operations.d.ts +27 -0
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +186 -7
- package/dist/operations.js.map +1 -1
- package/dist/patterns.d.ts +27 -1
- package/dist/patterns.d.ts.map +1 -1
- package/dist/patterns.js +211 -45
- package/dist/patterns.js.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +27 -5
- package/dist/plugin.js.map +1 -1
- package/dist/recommend.d.ts +4 -5
- package/dist/recommend.d.ts.map +1 -1
- package/dist/recommend.js +110 -45
- package/dist/recommend.js.map +1 -1
- package/dist/registry.d.ts +32 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +165 -9
- package/dist/registry.js.map +1 -1
- package/dist/run-records.d.ts +3 -0
- package/dist/run-records.d.ts.map +1 -1
- package/dist/run-records.js +18 -0
- package/dist/run-records.js.map +1 -1
- package/dist/score.d.ts +95 -0
- package/dist/score.d.ts.map +1 -1
- package/dist/score.js +274 -2
- package/dist/score.js.map +1 -1
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +20 -17
- package/dist/setup.js.map +1 -1
- package/dist/skill-selection.d.ts +72 -0
- package/dist/skill-selection.d.ts.map +1 -0
- package/dist/skill-selection.js +76 -0
- package/dist/skill-selection.js.map +1 -0
- package/dist/stem.d.ts +12 -0
- package/dist/stem.d.ts.map +1 -0
- package/dist/stem.js +89 -0
- package/dist/stem.js.map +1 -0
- package/dist/target-integrations.d.ts +65 -0
- package/dist/target-integrations.d.ts.map +1 -0
- package/dist/target-integrations.js +152 -0
- package/dist/target-integrations.js.map +1 -0
- package/dist/telemetry-vocabulary.d.ts +7 -0
- package/dist/telemetry-vocabulary.d.ts.map +1 -1
- package/dist/telemetry-vocabulary.js +29 -0
- package/dist/telemetry-vocabulary.js.map +1 -1
- package/dist/vector-tier.d.ts +6 -1
- package/dist/vector-tier.d.ts.map +1 -1
- package/dist/vector-tier.js +32 -7
- package/dist/vector-tier.js.map +1 -1
- package/package.json +7 -6
- package/sbom.json +772 -112
- package/src/amendment-trace.ts +12 -1
- package/src/codex-invoke.ts +138 -0
- package/src/compounding.ts +300 -1
- package/src/discrimination-gate.ts +183 -19
- package/src/eta.ts +590 -0
- package/src/event-chain.ts +41 -0
- package/src/feature-adr-checkpoints.ts +1 -1
- package/src/feature-adr-decision-recall.ts +652 -0
- package/src/feature-adr-landing.ts +109 -0
- package/src/feature-adr-routing.ts +7 -11
- package/src/guard-promotion.ts +245 -4
- package/src/guard-volume.ts +752 -0
- package/src/guard.ts +110 -4
- package/src/index.ts +73 -6
- package/src/integration-apply.ts +332 -0
- package/src/integration-evidence.ts +89 -0
- package/src/integration-probe-worker.ts +310 -0
- package/src/integration-receipts/claude-code/mcp/2.1.235.json +35 -0
- package/src/integrations-verify.ts +258 -0
- package/src/lesson-generalization.ts +115 -0
- package/src/mutation-gate.ts +165 -5
- package/src/operations.ts +207 -7
- package/src/patterns.ts +252 -43
- package/src/plugin.ts +27 -5
- package/src/recommend.ts +116 -46
- package/src/registry.ts +144 -11
- package/src/run-records.ts +23 -0
- package/src/score.ts +361 -3
- package/src/setup.ts +20 -17
- package/src/skill-selection.ts +111 -0
- package/src/stem.ts +87 -0
- package/src/target-integrations.ts +225 -0
- package/src/telemetry-vocabulary.ts +36 -0
- package/src/vector-tier.ts +44 -14
package/src/guard.ts
CHANGED
|
@@ -11,8 +11,16 @@
|
|
|
11
11
|
// PURE: `evaluateGuard` operates over INJECTED FACTS (package.json deps, a drift result, lesson text, README
|
|
12
12
|
// counts, store size) that the CLI gathers. No filesystem here → deterministic + unit-testable without a repo.
|
|
13
13
|
|
|
14
|
-
import { type RuleTemplate, type TemplateParams, type ChangeSet, templateFires, validTemplateParams } from './guard-promotion.js';
|
|
14
|
+
import { lessonRuleContentAnchor, type RuleTemplate, type TemplateParams, type ChangeSet, templateFires, validTemplateParams } from './guard-promotion.js';
|
|
15
15
|
import { STUB_MARKERS, STUB_PHRASES, checkNoStubs, type StubWaiver } from './no-stubs.js';
|
|
16
|
+
import {
|
|
17
|
+
VOLUME_SHADOW_RULE_IDS,
|
|
18
|
+
evaluateVolumeShadow,
|
|
19
|
+
unknownVolumeShadow,
|
|
20
|
+
type GuardObservation,
|
|
21
|
+
type VolumeShadowInput,
|
|
22
|
+
type VolumeShadowResult,
|
|
23
|
+
} from './guard-volume.js';
|
|
16
24
|
|
|
17
25
|
export type GuardSeverity = 'hard' | 'soft';
|
|
18
26
|
export type GuardOp = 'publish' | 'teach' | 'consolidate' | 'reindex';
|
|
@@ -39,6 +47,8 @@ export interface Violation {
|
|
|
39
47
|
readonly rule: string;
|
|
40
48
|
readonly severity: GuardSeverity;
|
|
41
49
|
readonly detail: string;
|
|
50
|
+
/** Present for promoted-template firings; ids alone do not prove equal effective rule content. */
|
|
51
|
+
readonly contentAnchor?: string;
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
export interface GuardResult {
|
|
@@ -54,15 +64,24 @@ export interface GuardResult {
|
|
|
54
64
|
* argument; a note is the cheap fix. Present only when non-empty.
|
|
55
65
|
*/
|
|
56
66
|
readonly notes?: readonly string[];
|
|
67
|
+
/** Versioned shadow measurements. They are evidence only and never enter the verdict reducer. */
|
|
68
|
+
readonly observations?: readonly GuardObservation[];
|
|
57
69
|
}
|
|
58
70
|
|
|
59
71
|
/** Facts the CLI injects; each rule reads only the fields it needs. Missing evidence ⇒ that rule is skipped. */
|
|
60
72
|
export interface GuardFacts {
|
|
61
73
|
readonly op: GuardOp;
|
|
74
|
+
/** Publish-only raw volume facts. Absence preserves the legacy result shape. */
|
|
75
|
+
readonly volume?: VolumeShadowInput;
|
|
62
76
|
/** for no-workspace-star: each publishable package's deps map. */
|
|
63
77
|
readonly packages?: readonly { readonly name: string; readonly deps: Readonly<Record<string, string>> }[];
|
|
64
78
|
/** for no-skill-drift: the names that byte-drift between copies (from sweepSkillDrift). */
|
|
65
79
|
readonly drift?: readonly string[];
|
|
80
|
+
/**
|
|
81
|
+
* for codex-wrapper-for-value-stage: workflow scripts to scan, as (path, text). Absent ⇒ the
|
|
82
|
+
* rule reports nothing: a guard with no evidence must stay silent rather than invent a verdict.
|
|
83
|
+
*/
|
|
84
|
+
readonly workflowScripts?: readonly { readonly path: string; readonly text: string }[];
|
|
66
85
|
/** for no-secrets: labelled blobs to scan (lesson text, staged files). */
|
|
67
86
|
readonly secretTargets?: readonly { readonly label: string; readonly text: string }[];
|
|
68
87
|
/** for readme-consistency: labelled (a,b) count pairs that must be equal. */
|
|
@@ -287,7 +306,12 @@ export const DEFAULT_RULES: readonly GuardRule[] = [
|
|
|
287
306
|
{ id: 'readme-first', severity: 'soft', ops: ['publish'], description: 'a package with a staged version bump must update its own README.md in the same change (README-first)' },
|
|
288
307
|
{ id: 'routing-store-stale', severity: 'soft', ops: ['publish'], description: 'harvested routing telemetry has been applied to the auto-cost outcome store' },
|
|
289
308
|
{ id: 'marketplace-parity', severity: 'soft', ops: ['publish'], description: 'the published .claude-plugin/ showcase composition matches a fresh regeneration from the live registry (version excluded — an operator field)' },
|
|
309
|
+
{ id: 'template-context-token-weight', severity: 'soft', ops: ['publish'], description: 'observe the UTF-8-byte estimated token weight of each selected template context corpus; measured starting points are advisory only' },
|
|
310
|
+
{ id: 'template-context-largest-file-share', severity: 'soft', ops: ['publish'], description: 'observe the largest template file share on the same estimated-token basis as its corpus total; advisory only' },
|
|
311
|
+
{ id: 'feature-artifact-diff-ratio', severity: 'soft', ops: ['publish'], description: 'observe feature artifact bytes against attributable unified-diff bytes, explicitly a proxy; advisory only' },
|
|
312
|
+
{ id: 'feature-tier-artifact-set', severity: 'soft', ops: ['publish'], description: 'observe artifacts due for the recorded feature tier, active steps, consumers, and lifecycle; advisory only' },
|
|
290
313
|
{ id: 'agents-md-policy-sync', severity: 'soft', ops: ['publish'], description: 'proves the AGENTS.md copy is in SYNC with its source — not that the runtime read or obeyed it; heal drift with dz agents-sync' },
|
|
314
|
+
{ id: 'codex-wrapper-for-value-stage', severity: 'hard', ops: ['publish'], description: 'a workflow stage routed to the fire-and-forget codex wrapper must not have its return value consumed — the wrapper answers with a dispatch stub, never with the model' },
|
|
291
315
|
{ id: 'lockfile-in-sync', severity: 'soft', ops: ['publish'], description: 'every workspace @dzhechkov/* dependency spec matches the specifier pnpm-lock.yaml records for that importer (a dep bump without a lockfile refresh breaks CI with ERR_PNPM_OUTDATED_LOCKFILE). SOFT-ONLY — a config cannot promote it to HARD' },
|
|
292
316
|
{ id: 'store-bloat-cap', severity: 'soft', ops: ['teach', 'consolidate'], description: 'the learned store is within its size cap' },
|
|
293
317
|
// Description ASSEMBLED from STUB_MARKERS so guard.ts itself stays clean under the scan it defines
|
|
@@ -492,6 +516,40 @@ const CHECKERS: Record<string, (f: GuardFacts, sev: GuardSeverity) => Violation[
|
|
|
492
516
|
detail: `${drifted.length} AGENTS.md policy section(s) are out of sync: ${drifted.slice(0, 8).join(', ')}${drifted.length > 8 ? '…' : ''} — heal with: dz agents-sync`,
|
|
493
517
|
}];
|
|
494
518
|
},
|
|
519
|
+
/**
|
|
520
|
+
* The fire-and-forget wrapper returns a DISPATCH STUB, so a stage whose deliverable is its
|
|
521
|
+
* return value gets a receipt instead of an answer. MEASURED 2026-08-31: eight stages of one
|
|
522
|
+
* research swarm each returned "Codex Task started in the background as task-…", downstream
|
|
523
|
+
* agents built on those stubs, and no artifact was produced. The misuse is visible in the
|
|
524
|
+
* program text — the stage's result is assigned to a name that a later prompt interpolates —
|
|
525
|
+
* so it belongs on layer 1 rather than in a rule nobody re-reads.
|
|
526
|
+
*/
|
|
527
|
+
'codex-wrapper-for-value-stage': (f, sev) => {
|
|
528
|
+
const scripts = f.workflowScripts;
|
|
529
|
+
if (scripts === undefined || scripts.length === 0) return [];
|
|
530
|
+
const out: Violation[] = [];
|
|
531
|
+
for (const s of scripts) {
|
|
532
|
+
const text = String(s.text ?? '');
|
|
533
|
+
// Find `const <name> = await agent(… codex:codex-rescue …)` and ask whether <name> is later
|
|
534
|
+
// interpolated into another prompt. Assignment alone is not the defect: a stage may keep its
|
|
535
|
+
// handle for logging. Consumption in a prompt is what proves the VALUE was the deliverable.
|
|
536
|
+
const re = /(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*await\s+agent\(([\s\S]{0,4000}?)\)\s*(?:\n|;)/g;
|
|
537
|
+
for (const m of text.matchAll(re)) {
|
|
538
|
+
const name = String(m[1]);
|
|
539
|
+
const call = String(m[2]);
|
|
540
|
+
if (!/codex:codex-rescue/.test(call)) continue;
|
|
541
|
+
const consumed = new RegExp('\\$\\{\\s*(?:String\\()?' + name.replace(/[.*+?^{}()|[\]\\]/g, '\\$&') + '\\b');
|
|
542
|
+
if (consumed.test(text)) {
|
|
543
|
+
out.push({
|
|
544
|
+
rule: 'codex-wrapper-for-value-stage',
|
|
545
|
+
severity: sev,
|
|
546
|
+
detail: `${s.path}: stage "${name}" is routed to codex:codex-rescue AND its result is interpolated into another prompt — the wrapper returns a dispatch stub, so that prompt would receive a receipt, not an answer. Invoke codex synchronously (dz codex / codex exec) for a stage whose deliverable is its return value.`,
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
return out;
|
|
552
|
+
},
|
|
495
553
|
'lockfile-in-sync': (f, _sev) => {
|
|
496
554
|
// The 2026-07-28 CI break, mechanized: an overnight dep bump edited package.json and left
|
|
497
555
|
// pnpm-lock.yaml stale, so `pnpm install --frozen-lockfile` died with ERR_PNPM_OUTDATED_LOCKFILE.
|
|
@@ -586,7 +644,13 @@ const CHECKERS: Record<string, (f: GuardFacts, sev: GuardSeverity) => Violation[
|
|
|
586
644
|
* may not understand a file, and "I might be wrong" plus "block the publish" is the wrong pair. Disabling
|
|
587
645
|
* such a rule stays allowed — only the promotion is refused.
|
|
588
646
|
*/
|
|
589
|
-
export const SOFT_ONLY_RULES: readonly string[] = [
|
|
647
|
+
export const SOFT_ONLY_RULES: readonly string[] = [
|
|
648
|
+
'lockfile-in-sync',
|
|
649
|
+
'agents-md-policy-sync',
|
|
650
|
+
'routing-store-stale',
|
|
651
|
+
'marketplace-parity',
|
|
652
|
+
...VOLUME_SHADOW_RULE_IDS,
|
|
653
|
+
];
|
|
590
654
|
|
|
591
655
|
/**
|
|
592
656
|
* A well-formed PROMOTED rule: an id the engine does not know, made enforceable by a template +
|
|
@@ -612,7 +676,12 @@ function templateChecker(rule: GuardRule & { template: RuleTemplate; params: Tem
|
|
|
612
676
|
const r = templateFires(rule.template, rule.params, change);
|
|
613
677
|
if (Object.hasOwn(r, 'undecidable') || !(r as { fired?: boolean }).fired) return [];
|
|
614
678
|
// A promoted rule is ALWAYS soft, whatever severity reaches this point (belt to resolveRules' braces).
|
|
615
|
-
return [{
|
|
679
|
+
return [{
|
|
680
|
+
rule: rule.id,
|
|
681
|
+
severity: 'soft',
|
|
682
|
+
detail: `${(r as { detail?: string }).detail ?? 'template rule fired'} (promoted rule — advisory)`,
|
|
683
|
+
contentAnchor: lessonRuleContentAnchor(rule.template, rule.params),
|
|
684
|
+
}];
|
|
616
685
|
};
|
|
617
686
|
}
|
|
618
687
|
|
|
@@ -671,8 +740,32 @@ export function evaluateGuard(facts: GuardFacts, rules: readonly GuardRule[] = D
|
|
|
671
740
|
);
|
|
672
741
|
const violations: Violation[] = [];
|
|
673
742
|
const checked: string[] = [];
|
|
743
|
+
const observations: GuardObservation[] = [];
|
|
744
|
+
let volumeResult: VolumeShadowResult | undefined;
|
|
745
|
+
let volumeEvaluated = false;
|
|
746
|
+
const volume = (): VolumeShadowResult => {
|
|
747
|
+
if (volumeEvaluated) return volumeResult ?? { observations: [], signals: [], notes: [] };
|
|
748
|
+
volumeEvaluated = true;
|
|
749
|
+
try {
|
|
750
|
+
volumeResult = evaluateVolumeShadow(facts.volume);
|
|
751
|
+
} catch (error) {
|
|
752
|
+
volumeResult = unknownVolumeShadow(
|
|
753
|
+
'volume-evaluator-failure',
|
|
754
|
+
error instanceof Error ? error.message : String(error),
|
|
755
|
+
);
|
|
756
|
+
}
|
|
757
|
+
return volumeResult;
|
|
758
|
+
};
|
|
674
759
|
for (const r of active) {
|
|
675
760
|
checked.push(r.id);
|
|
761
|
+
if ((VOLUME_SHADOW_RULE_IDS as readonly string[]).includes(r.id)) {
|
|
762
|
+
const emission = volume();
|
|
763
|
+
observations.push(...emission.observations.filter((item) => item.rule === r.id));
|
|
764
|
+
violations.push(...emission.signals
|
|
765
|
+
.filter((signal) => signal.rule === r.id)
|
|
766
|
+
.map((signal) => ({ rule: signal.rule, severity: 'soft' as const, detail: signal.detail })));
|
|
767
|
+
continue;
|
|
768
|
+
}
|
|
676
769
|
// A promoted (template) rule has no built-in checker by design — it is enforceable through the
|
|
677
770
|
// shared `templateFires` predicate instead. Without this branch a promoted rule written into
|
|
678
771
|
// `.dz/guard.json` would be INERT: present in the config, listed as checked, enforcing nothing —
|
|
@@ -720,7 +813,17 @@ export function evaluateGuard(facts: GuardFacts, rules: readonly GuardRule[] = D
|
|
|
720
813
|
notes.push('agents-md-policy-sync: this repository carries a dz:policies fence but its canonical policy sources are unreadable — the advisory rule could not compare, and that gap is on the record, not a silent pass');
|
|
721
814
|
}
|
|
722
815
|
}
|
|
723
|
-
|
|
816
|
+
for (const item of observations) {
|
|
817
|
+
if (item.status === 'unknown') notes.push(`${item.rule} ${item.scope}: ${item.detail}`);
|
|
818
|
+
}
|
|
819
|
+
return {
|
|
820
|
+
op,
|
|
821
|
+
verdict,
|
|
822
|
+
violations,
|
|
823
|
+
checked,
|
|
824
|
+
...(notes.length > 0 ? { notes } : {}),
|
|
825
|
+
...(observations.length > 0 ? { observations } : {}),
|
|
826
|
+
};
|
|
724
827
|
}
|
|
725
828
|
|
|
726
829
|
/** An append-only audit record. `ts` is injected by the caller (no wall-clock here → deterministic tests). */
|
|
@@ -731,6 +834,8 @@ export interface GuardAuditRecord {
|
|
|
731
834
|
readonly violations: readonly Violation[];
|
|
732
835
|
/** informational notes (FN-7 — e.g. the no-stubs skipped-files note); on the record, never a verdict input. */
|
|
733
836
|
readonly notes?: readonly string[];
|
|
837
|
+
/** Shadow measurements copied without recomputation from the evaluated result. */
|
|
838
|
+
readonly observations?: readonly GuardObservation[];
|
|
734
839
|
/** set when the operator overrode a block with `--force <reason>` — the override is logged, never silent. */
|
|
735
840
|
readonly override?: { readonly forced: true; readonly reason: string };
|
|
736
841
|
}
|
|
@@ -743,6 +848,7 @@ export function auditRecord(result: GuardResult, ts: string, override?: { reason
|
|
|
743
848
|
verdict: result.verdict,
|
|
744
849
|
violations: result.violations,
|
|
745
850
|
...(Array.isArray(result.notes) && result.notes.length > 0 ? { notes: result.notes } : {}),
|
|
851
|
+
...(Array.isArray(result.observations) && result.observations.length > 0 ? { observations: result.observations } : {}),
|
|
746
852
|
...(override && typeof override.reason === 'string' ? { override: { forced: true, reason: override.reason } } : {}),
|
|
747
853
|
};
|
|
748
854
|
}
|
package/src/index.ts
CHANGED
|
@@ -15,6 +15,11 @@ export * from './apply.js';
|
|
|
15
15
|
export { bundleSkills } from './bundle.js';
|
|
16
16
|
export type { BundleOptions, BundleResult, BundledSkill } from './bundle.js';
|
|
17
17
|
export * from './targets.js';
|
|
18
|
+
export * from './target-integrations.js';
|
|
19
|
+
export * from './integration-evidence.js';
|
|
20
|
+
export * from './integration-apply.js';
|
|
21
|
+
export * from './integrations-verify.js';
|
|
22
|
+
export { redactProbeText, PROBE_REDACTION_MARKER } from './integration-probe-worker.js';
|
|
18
23
|
// Target-parity model (feature target-parity-matrix, ADR-001) — the computed feature×target map.
|
|
19
24
|
export {
|
|
20
25
|
RUNTIME_CAPABILITIES,
|
|
@@ -78,8 +83,8 @@ export type { SyncUpstreamReport, UpstreamCheckResult, SourcesManifest, SourcePa
|
|
|
78
83
|
export { sweepSkillDrift, syncCanonicalSkill } from './skill-drift.js';
|
|
79
84
|
export { SKILL_INSTALL_ROOTS, SKILL_INSTALL_ROOT_BY_TARGET, DEV_SKILL_ROOT, TARGET_ENRICHMENT_ASSETS } from './skill-install-roots.js';
|
|
80
85
|
export { stampCheckpointLine } from './checkpoint-stamp.js';
|
|
81
|
-
export { TELEMETRY_VOCAB_VERSION, TELEMETRY_FIELDS, PROVISIONAL_TELEMETRY_FIELDS, LOCAL_FIELD_ALIASES, telemetryFieldFor } from './telemetry-vocabulary.js';
|
|
82
|
-
export type { TelemetryField, FieldSource } from './telemetry-vocabulary.js';
|
|
86
|
+
export { TELEMETRY_VOCAB_VERSION, TELEMETRY_FIELDS, PROVISIONAL_TELEMETRY_FIELDS, LOCAL_FIELD_ALIASES, RUN_OUTCOMES, telemetryFieldFor, runOutcomeOf } from './telemetry-vocabulary.js';
|
|
87
|
+
export type { TelemetryField, FieldSource, RunOutcome } from './telemetry-vocabulary.js';
|
|
83
88
|
export { planLedgerBackfill, LEDGER_FILL_SOURCE, AMBIGUOUS, resolveLedgerRunId } from './ledger-backfill.js';
|
|
84
89
|
// project-skills root resolution (field report doc-25b): the ONE builder behind both the Step-0
|
|
85
90
|
// probe and the PS_GUIDANCE paragraph, so the two can never look at different roots again.
|
|
@@ -87,14 +92,16 @@ export { projectSkillsOneRoot, projectSkillsProbeCommand } from './project-skill
|
|
|
87
92
|
export type { LedgerBackfillPlan, LedgerBackfillRow, RunCostFacts } from './ledger-backfill.js';
|
|
88
93
|
export type { SweepResult, DriftedSkill, SyncResult, SyncCanonicalOptions } from './skill-drift.js';
|
|
89
94
|
export { benchmarkSkill, benchmarkSkills, compareSkills } from './benchmark.js';
|
|
90
|
-
export { buildRegistry, searchRegistry, filterByCategory, skillPackBaseDirs, discoverSkillPackDirs, discoverVerifiablePackDirs } from './registry.js';
|
|
95
|
+
export { buildRegistry, searchRegistry, filterByCategory, skillPackBaseDirs, discoverSkillPackDirs, discoverSkillCarryingDirs, discoverVerifiablePackDirs } from './registry.js';
|
|
96
|
+
export { tokenize, stemToken, stems } from './stem.js';
|
|
91
97
|
// Package skill-layout resolution (feature dz-install-npx-init) — the ONE seam that knows where an
|
|
92
98
|
// npm package keeps its skills (flat / templates/.claude/skills / skills). `cmdInstall` calls it;
|
|
93
99
|
// `dz init`/`dz registry` are the filed follow-up consumers.
|
|
94
100
|
export * from './package-skill-layouts.js';
|
|
95
101
|
export { recommend } from './recommend.js';
|
|
96
102
|
export { pretrain } from './pretrain.js';
|
|
97
|
-
export { loadPatterns, loadSessions, computePatternBoost, readLearningConfig, readMemoryLearningConfig, BOOST_CAP, recordPattern, loadStorePatternsSync, loadStoreRecords, patternToRecord, recordToPattern, patternRecordId, patternIdentityOf, dreamRecordId, isMirrorableLearning, consolidateSessions, recallPatterns, pruneNoisePatterns, removePatternsByIds, snapshotStore, readReinforcementState, encodeReinforcementState, reinforcePattern, updateReinforcementState, storeStats, lessonDeltaReport, lessonDeltaMap, readQuarantineState, encodeQuarantineState, promotePatterns, quarantineExpiryCandidates, pruneQuarantinePatterns } from './patterns.js';
|
|
103
|
+
export { loadPatterns, loadSessions, computePatternBoost, readLearningConfig, readMemoryLearningConfig, BOOST_CAP, recordPattern, recordLessonForms, loadStorePatternsSync, loadStoreRecords, patternToRecord, recordToPattern, patternRecordId, patternIdentityOf, dreamRecordId, isMirrorableLearning, consolidateSessions, recallPatterns, pruneNoisePatterns, removePatternsByIds, snapshotStore, readReinforcementState, encodeReinforcementState, reinforcePattern, updateReinforcementState, storeStats, lessonDeltaReport, lessonDeltaMap, readQuarantineState, encodeQuarantineState, promotePatterns, quarantineExpiryCandidates, pruneQuarantinePatterns } from './patterns.js';
|
|
104
|
+
export { normalizeLessonForms, validateClassTemplate, lessonPairIdOf, mergeLessonFormHits, mergeLessonMatchedForms } from './lesson-generalization.js';
|
|
98
105
|
export { withStoreLock, withStoreLockSync, storeLockPath, StoreLockTimeoutError, StoreLockCompromisedError, STALE_LOCK_MS, LOCK_TIMEOUT_MS } from './store-lock.js';
|
|
99
106
|
export type { StoreLockOptions } from './store-lock.js';
|
|
100
107
|
export { withNamedLockSync, namedLockPath, isSafeLockName, NamedLockNameError, NamedLockTimeoutError, NamedLockCompromisedError } from './named-lock.js';
|
|
@@ -121,7 +128,8 @@ export {
|
|
|
121
128
|
renderBridgeReport,
|
|
122
129
|
} from './qe-bridge.js';
|
|
123
130
|
export type { BridgeFamily, BridgeFailureReason, BridgeFinding, BridgeSignoff, BridgeParse, BridgeParseOk, BridgeParseFail, BridgeChannels, BridgeAudit, ClaudeResultExtraction, NamedExtract, BridgePromptInput } from './qe-bridge.js';
|
|
124
|
-
export type { PatternRecord, SessionRecord, LearningConfig, MemoryLearningConfig, LoadOptions, ConsolidateResult, ConsolidateOptions, SqliteBackendMode, RecallHit, SessionsSource, PruneNoiseResult, RemovePatternsResult, SnapshotStoreResult, ReinforcementState, ReinforcePatternResult, StoreStats, LessonDeltaReport, LessonDeltaRow, QuarantineState, PromoteResult, QuarantineExpiryCandidate } from './patterns.js';
|
|
131
|
+
export type { PatternRecord, SessionRecord, LearningConfig, MemoryLearningConfig, LoadOptions, ConsolidateResult, ConsolidateOptions, SqliteBackendMode, RecallHit, RecallPatternsOptions, RecordLessonFormsResult, SessionsSource, PruneNoiseResult, RemovePatternsResult, SnapshotStoreResult, ReinforcementState, ReinforcePatternResult, StoreStats, LessonDeltaReport, LessonDeltaRow, QuarantineState, PromoteResult, QuarantineExpiryCandidate } from './patterns.js';
|
|
132
|
+
export type { LessonForm, LessonMatchedForm, LessonFormsInput, LessonFormRankedHit, MergedLessonFormHit } from './lesson-generalization.js';
|
|
125
133
|
export { DEFAULT_REINFORCE_THRESHOLD, NoopLearningBackend, NativeReinforcementBackend, resolveLearningBackend, isLearningSignalBackend, applyLearningSignals, applyLearningSignalsWithDelta, applyLearningSignalsWithTerms } from './learning-backend.js';
|
|
126
134
|
export type { LearningSignalBackend, LearningSignalStats, LearningSample, SignalCandidate, EnhanceContext, TrainingResult, LearningBackendMode, RerankTerm } from './learning-backend.js';
|
|
127
135
|
// lesson-bandit-rerank (I-8): the ACL's public surface only. The vendored engine class is
|
|
@@ -186,6 +194,15 @@ export { runSetup, generateHooksConfig, generateAgentdbWriter, writerVersionOf,
|
|
|
186
194
|
agentdbStorePath, agentdbMcpStorePath, agentdbStoreSeparationProblem } from './setup.js';
|
|
187
195
|
export { statuslineData, readFeatureAdrState, writeFeatureAdrState, featureAdrStateDir, featureAdrStatePath } from './statusline.js';
|
|
188
196
|
export type { StatuslineData, FeatureAdrState, WriteFeatureAdrStateInput } from './statusline.js';
|
|
197
|
+
export {
|
|
198
|
+
ETA_MAX_STAGE_MS,
|
|
199
|
+
estimateEta,
|
|
200
|
+
extractStageSamples,
|
|
201
|
+
formatEta,
|
|
202
|
+
parseCheckpointLines,
|
|
203
|
+
segmentRun,
|
|
204
|
+
} from './eta.js';
|
|
205
|
+
export type { CheckpointObservation, EtaEstimate, EtaInput, IncompleteCoverageSample, RunSegment, StageDurationSample, StageSample } from './eta.js';
|
|
189
206
|
export { indexPatternsToAgentdb, resolveAgentdbPath, searchAgentdbPatterns, listAgentdbDzIds, resolveAgentdbEmbedder, cosineSimilarity, importVectorsToAgentdb, reindexAgentdbRows, bumpAgentdbUses, clearAgentdbQuarantine, deleteAgentdbByDzIds, readAgentdbRowsByTaskType, DZ_OWNED_TASK_TYPES } from './agentdb-index.js';
|
|
190
207
|
export type { AgentdbSearchHit, AgentdbSearchResult, AgentdbImportRow } from './agentdb-index.js';
|
|
191
208
|
export { DEFAULT_EMBED_MODEL, LEGACY_EMBED_MODEL, DEFAULT_EMBED_DIM, KNOWN_EMBED_DIMS, resolveEmbedModel, readEmbedManifest, writeEmbedManifest, embedManifestPath, legacyEmbedManifest } from './embedding-config.js';
|
|
@@ -250,6 +267,50 @@ export { hookDecision, isFenced, isNewLine, ESCAPE_TEACHING } from './claim-chec
|
|
|
250
267
|
export type { HookDecision, HookDecisionOpts } from './claim-check-hook-policy.js';
|
|
251
268
|
export { step8ClaimGate } from './feature-adr-claim-gate.js';
|
|
252
269
|
export type { Step8ClaimCounts, Step8ClaimGate } from './feature-adr-claim-gate.js';
|
|
270
|
+
export {
|
|
271
|
+
DEFAULT_CODE_LANDING_CEILING_MS,
|
|
272
|
+
CODE_LANDING_CEILING_ENV,
|
|
273
|
+
decideCodeLandingLiveness,
|
|
274
|
+
extractCodexCompanionJobId,
|
|
275
|
+
parseCodeLandingLivenessSignal,
|
|
276
|
+
} from './feature-adr-landing.js';
|
|
277
|
+
export type {
|
|
278
|
+
CodeLandingLivenessVerdict,
|
|
279
|
+
CodeLandingLivenessReason,
|
|
280
|
+
CodeLandingLivenessInput,
|
|
281
|
+
CodeLandingLivenessDecision,
|
|
282
|
+
CodeLandingLivenessProbe,
|
|
283
|
+
} from './feature-adr-landing.js';
|
|
284
|
+
export {
|
|
285
|
+
buildDecisionContext,
|
|
286
|
+
normalizeDecisionRecall,
|
|
287
|
+
parseDecisionRecallFrame,
|
|
288
|
+
parseDecisionRecallApplicationProbe,
|
|
289
|
+
mergeDecisionRecallEvents,
|
|
290
|
+
reduceDecisionRecallMetrics,
|
|
291
|
+
summarizeDecisionRecallReceipts,
|
|
292
|
+
decisionRecallEnterCmd,
|
|
293
|
+
decisionRecallRunCmd,
|
|
294
|
+
decisionRecallAppendCmd,
|
|
295
|
+
decisionRecallApplicationProbeCmd,
|
|
296
|
+
} from './feature-adr-decision-recall.js';
|
|
297
|
+
export type {
|
|
298
|
+
DecisionRecallKind,
|
|
299
|
+
DecisionRecallStage,
|
|
300
|
+
DecisionRecallOutcomeName,
|
|
301
|
+
DecisionRecallContext,
|
|
302
|
+
DecisionRecallFrame,
|
|
303
|
+
DecisionRecallSelection,
|
|
304
|
+
DecisionRecallOutcome,
|
|
305
|
+
DecisionRecallEvent,
|
|
306
|
+
DecisionRecallDisposition,
|
|
307
|
+
DecisionRecallApplicationProbe,
|
|
308
|
+
MergedDecisionRecallAttempt,
|
|
309
|
+
MergedDecisionRecallDecision,
|
|
310
|
+
MergedDecisionRecallEvents,
|
|
311
|
+
DecisionRecallRatio,
|
|
312
|
+
DecisionRecallMetrics,
|
|
313
|
+
} from './feature-adr-decision-recall.js';
|
|
253
314
|
export {
|
|
254
315
|
CHECKPOINT_STAGES,
|
|
255
316
|
STAGE_ARTIFACTS,
|
|
@@ -517,6 +578,7 @@ export {
|
|
|
517
578
|
DEFAULT_REWRITE_ATTEMPTS,
|
|
518
579
|
liveSegmentStart,
|
|
519
580
|
classifyChainDefects,
|
|
581
|
+
CHAINED_JOURNALS,
|
|
520
582
|
} from './event-chain.js';
|
|
521
583
|
export type {
|
|
522
584
|
ChainFields,
|
|
@@ -533,6 +595,7 @@ export type {
|
|
|
533
595
|
VerifyEventChainOptions,
|
|
534
596
|
ChainDefectAge,
|
|
535
597
|
ChainDefectAges,
|
|
598
|
+
ChainedJournal,
|
|
536
599
|
} from './event-chain.js';
|
|
537
600
|
export { decideProvenance, environmentCanMintProvenance, publishArgv, discoverPackages, publishPackages, bumpPatch, compareVersions, findUnpackagedSkills, findUnpublishedWorkspaceFloors, orderByDependencies, syncReadmeVersion, isChangelogEntryLine, changelogRegion } from './publish.js';
|
|
538
601
|
export { fetchAllDownloads } from './downloads.js';
|
|
@@ -826,6 +889,7 @@ export * from './model-recommender.js';
|
|
|
826
889
|
export * from './bto-optimize.js';
|
|
827
890
|
export * from './discrimination-gate.js';
|
|
828
891
|
export * from './guard.js';
|
|
892
|
+
export * from './guard-volume.js';
|
|
829
893
|
// Root AGENTS.md policy projection: pure anchor extraction/render/hash drift +
|
|
830
894
|
// the shared-emitter I/O entry point exported from operations.
|
|
831
895
|
export * from './agents-policy.js';
|
|
@@ -900,7 +964,8 @@ export {
|
|
|
900
964
|
} from './epoch-replay.js';
|
|
901
965
|
|
|
902
966
|
// Run-process scorecard (feature dz-score, Reading C) — scores the DISCIPLINE of a feature-adr run
|
|
903
|
-
// from its artifacts. Descriptive-only,
|
|
967
|
+
// from its artifacts and folds immutable receipts into a chained aggregate. Descriptive-only,
|
|
968
|
+
// permanently: neither the single-run score nor the aggregate gates.
|
|
904
969
|
export * from './score.js';
|
|
905
970
|
export * from './recap.js';
|
|
906
971
|
export * from './provenance.js';
|
|
@@ -976,3 +1041,5 @@ export type {
|
|
|
976
1041
|
Register, Domain, OperatorProfile, ProfileReadResult, ProfileSyncResult,
|
|
977
1042
|
ProfileDriftVerdict, ProfileDriftResult,
|
|
978
1043
|
} from './profile.js';
|
|
1044
|
+
export * from './codex-invoke.js';
|
|
1045
|
+
export * from './skill-selection.js';
|