etymd 0.14.0 → 0.15.0
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/CHANGELOG.md +14 -0
- package/README.md +30 -19
- package/dist/{approve-QDOH2E7V.js → approve-MA4Z3TBT.js} +2 -2
- package/dist/{audit-42OHF7ON.js → audit-YSALDC2L.js} +5 -4
- package/dist/{brief-ZUQK3CFL.js → brief-DPZYSAMC.js} +2 -2
- package/dist/{chunk-LT7JMVV3.js → chunk-2RNQ6OLV.js} +43 -730
- package/dist/{chunk-PAMWS665.js → chunk-CEO3BXQB.js} +2 -1
- package/dist/{chunk-623W6KVC.js → chunk-DBWDMIYO.js} +1 -1
- package/dist/chunk-IWG77WV3.js +758 -0
- package/dist/{chunk-HWC6PKJM.js → chunk-Y6RZRED3.js} +1 -1
- package/dist/cli.js +35 -14
- package/dist/{doctor-CE5SD4JW.js → doctor-Y3DWDEBT.js} +5 -4
- package/dist/{fleet-F3XDEDCV.js → fleet-4FYZ3GBK.js} +5 -4
- package/dist/{gates-F4YPKWJR.js → gates-IBQ7HCAN.js} +2 -2
- package/dist/index.d.ts +164 -1
- package/dist/index.js +498 -166
- package/dist/{init-AHA7VRRI.js → init-H57H2JBE.js} +2 -2
- package/dist/premise-VMC3UUIB.js +333 -0
- package/dist/scan-W4US23MU.js +5 -0
- package/dist/{scan-TVX3FKK4.js → scan-XBOHDXAH.js} +2 -2
- package/package.json +2 -2
- package/dist/scan-QRTH6HAP.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { VERSION } from './chunk-
|
|
2
|
+
import { VERSION } from './chunk-DBWDMIYO.js';
|
|
3
3
|
import { PACK_VERSION } from './chunk-YQZDYDAK.js';
|
|
4
4
|
import { normalizeRelPath, isDirectory, readJson, git, matchesAnyGlob, pathExists, readText } from './chunk-4VPBP6K6.js';
|
|
5
5
|
import path from 'path';
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { VERSION } from './chunk-
|
|
2
|
+
import { VERSION } from './chunk-DBWDMIYO.js';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
import pc from 'picocolors';
|
|
@@ -21,7 +21,7 @@ ${pc.red("\u2716")} ${message}
|
|
|
21
21
|
}
|
|
22
22
|
var program = new Command();
|
|
23
23
|
program.name("etymd").description(
|
|
24
|
-
"Keep your agent instructions true \u2014 verify AGENTS.md & friends against the actual repo, on a budget, with drift caught over time."
|
|
24
|
+
"Keep your agent instructions true \u2014 verify AGENTS.md & friends, and the task you hand an agent, against the actual repo, on a budget, with drift caught over time."
|
|
25
25
|
).version(VERSION, "-v, --version").option("--cwd <dir>", "run against a different project directory", process.cwd());
|
|
26
26
|
program.command("audit").description("Verify every instruction claim against the repo: ranked findings + ledger diff").option("--json", "print the machine-stable audit result as JSON").option("--truth", "truth lenses only (the doctor subset)").option(
|
|
27
27
|
"--lens <id>",
|
|
@@ -31,7 +31,7 @@ program.command("audit").description("Verify every instruction claim against the
|
|
|
31
31
|
"exit non-zero when findings at/above this tier exist (risk|gap|polish)"
|
|
32
32
|
).action(
|
|
33
33
|
(opts, cmd) => action(async () => {
|
|
34
|
-
const { run } = await import('./audit-
|
|
34
|
+
const { run } = await import('./audit-YSALDC2L.js');
|
|
35
35
|
await run({
|
|
36
36
|
cwd: resolveCwd(cmd),
|
|
37
37
|
json: opts.json,
|
|
@@ -44,7 +44,7 @@ program.command("audit").description("Verify every instruction claim against the
|
|
|
44
44
|
);
|
|
45
45
|
program.command("init").description("Onboard the truth guard: approve the baseline; scaffold AGENTS.md only if asked").option("-y, --yes", "accept defaults without prompting (never overwrites)").option("--with-agents", "also scaffold a minimal AGENTS.md where none exists (off by default)").action(
|
|
46
46
|
(opts, cmd) => action(async () => {
|
|
47
|
-
const { run } = await import('./init-
|
|
47
|
+
const { run } = await import('./init-H57H2JBE.js');
|
|
48
48
|
await run({ cwd: resolveCwd(cmd), yes: opts.yes, withAgents: opts.withAgents });
|
|
49
49
|
})
|
|
50
50
|
);
|
|
@@ -52,19 +52,19 @@ program.command("approve").description(
|
|
|
52
52
|
"Re-approve the committed baseline after intentional structural changes (non-interactive)"
|
|
53
53
|
).action(
|
|
54
54
|
(_opts, cmd) => action(async () => {
|
|
55
|
-
const { run } = await import('./approve-
|
|
55
|
+
const { run } = await import('./approve-MA4Z3TBT.js');
|
|
56
56
|
await run({ cwd: resolveCwd(cmd) });
|
|
57
57
|
})
|
|
58
58
|
);
|
|
59
59
|
program.command("scan").description("Deterministically reckon the project into a facts index").option("--json", "print the raw facts as JSON").option("--no-save", "do not write the .etymd cache").action(
|
|
60
60
|
(opts, cmd) => action(async () => {
|
|
61
|
-
const { run } = await import('./scan-
|
|
61
|
+
const { run } = await import('./scan-XBOHDXAH.js');
|
|
62
62
|
await run({ cwd: resolveCwd(cmd), json: opts.json, save: opts.save });
|
|
63
63
|
})
|
|
64
64
|
);
|
|
65
65
|
program.command("doctor").description('Alias for `audit --truth` \u2014 "are the recorded instructions still true?"').option("--json", "print findings as JSON").action(
|
|
66
66
|
(opts, cmd) => action(async () => {
|
|
67
|
-
const { run } = await import('./doctor-
|
|
67
|
+
const { run } = await import('./doctor-Y3DWDEBT.js');
|
|
68
68
|
await run({ cwd: resolveCwd(cmd), json: opts.json });
|
|
69
69
|
})
|
|
70
70
|
);
|
|
@@ -76,10 +76,31 @@ program.command("context").description("Measure the always-loaded context footpr
|
|
|
76
76
|
);
|
|
77
77
|
program.command("brief").description("Emit a grounded briefing for the in-repo agent to complete the semantic layer").option("--human", "write a human onboarding brief instead of the agent briefing").action(
|
|
78
78
|
(opts, cmd) => action(async () => {
|
|
79
|
-
const { run } = await import('./brief-
|
|
79
|
+
const { run } = await import('./brief-DPZYSAMC.js');
|
|
80
80
|
await run({ cwd: resolveCwd(cmd), human: opts.human });
|
|
81
81
|
})
|
|
82
82
|
);
|
|
83
|
+
program.command("premise").argument("[task]", "the task you are about to hand an agent, quoted").description(
|
|
84
|
+
"Before acting on a task: verify what it names against the repo, then brief the agent on what only it can verify"
|
|
85
|
+
).option(
|
|
86
|
+
"--file <path>",
|
|
87
|
+
"read the task from a file (a plan, an issue, a prompt); `-` reads stdin"
|
|
88
|
+
).option("--json", "print the machine-stable result as JSON (schema premise/1)").option("--no-brief", "do not write or print the agent brief").option(
|
|
89
|
+
"--fail-on <tier>",
|
|
90
|
+
"exit non-zero when findings at/above this tier exist (risk|gap|polish)"
|
|
91
|
+
).action(
|
|
92
|
+
(task, opts, cmd) => action(async () => {
|
|
93
|
+
const { run } = await import('./premise-VMC3UUIB.js');
|
|
94
|
+
await run({
|
|
95
|
+
cwd: resolveCwd(cmd),
|
|
96
|
+
task,
|
|
97
|
+
file: opts.file,
|
|
98
|
+
json: opts.json,
|
|
99
|
+
brief: opts.brief,
|
|
100
|
+
failOn: opts.failOn
|
|
101
|
+
});
|
|
102
|
+
})
|
|
103
|
+
);
|
|
83
104
|
program.command("ledger").description("List every tracked finding grouped by status (open \xB7 accepted \xB7 dismissed \xB7 \u2026)").option("--json", "print the raw ledger as JSON").action(
|
|
84
105
|
(opts, cmd) => action(async () => {
|
|
85
106
|
const { list } = await import('./ledger-T54JDHGP.js');
|
|
@@ -111,7 +132,7 @@ var fleet = program.command("fleet").description(
|
|
|
111
132
|
"exit non-zero when findings at/above this tier exist (risk|gap|polish)"
|
|
112
133
|
).action(
|
|
113
134
|
(opts, cmd) => action(async () => {
|
|
114
|
-
const { sweep } = await import('./fleet-
|
|
135
|
+
const { sweep } = await import('./fleet-4FYZ3GBK.js');
|
|
115
136
|
await sweep({
|
|
116
137
|
cwd: resolveCwd(cmd),
|
|
117
138
|
manifest: opts.manifest,
|
|
@@ -126,7 +147,7 @@ var fleet = program.command("fleet").description(
|
|
|
126
147
|
);
|
|
127
148
|
fleet.command("check").description("Validate the manifest pair only \u2014 no lenses: dangling mappings, duplicates, leaks").option("--manifest <file>", "the fleet manifest \u2014 required unless the cwd holds registry.json").option("--json", "print the findings as JSON (EXPERIMENTAL through 0.2.x)").action(
|
|
128
149
|
(_opts, cmd) => action(async () => {
|
|
129
|
-
const { check } = await import('./fleet-
|
|
150
|
+
const { check } = await import('./fleet-4FYZ3GBK.js');
|
|
130
151
|
const opts = cmd.optsWithGlobals();
|
|
131
152
|
await check({ cwd: resolveCwd(cmd), manifest: opts.manifest, json: opts.json });
|
|
132
153
|
})
|
|
@@ -136,7 +157,7 @@ fleet.command("add").argument("<dir>", "directory of the project to register").d
|
|
|
136
157
|
"public-repo | public-bound | private \u2014 mandatory for personal entries"
|
|
137
158
|
).option("-y, --yes", "skip prompts; every mandatory value must be passed as a flag").option("--manifest <file>", "the fleet manifest \u2014 required unless the cwd holds registry.json").action(
|
|
138
159
|
(dir, opts, cmd) => action(async () => {
|
|
139
|
-
const { add } = await import('./fleet-
|
|
160
|
+
const { add } = await import('./fleet-4FYZ3GBK.js');
|
|
140
161
|
const shared = cmd.optsWithGlobals();
|
|
141
162
|
await add({
|
|
142
163
|
cwd: resolveCwd(cmd),
|
|
@@ -159,7 +180,7 @@ fleet.command("dismiss").argument("<name>", "the registered project name").argum
|
|
|
159
180
|
"Dismiss a project's finding from any cwd \u2014 corp ledgers persist beside the manifest"
|
|
160
181
|
).requiredOption("--reason <text>", "why it is dismissed \u2014 recorded so the decision survives").option("--manifest <file>", "the fleet manifest \u2014 required unless the cwd holds registry.json").action(
|
|
161
182
|
(name, id, _opts, cmd) => action(async () => {
|
|
162
|
-
const { dismiss } = await import('./fleet-
|
|
183
|
+
const { dismiss } = await import('./fleet-4FYZ3GBK.js');
|
|
163
184
|
const opts = cmd.optsWithGlobals();
|
|
164
185
|
await dismiss({
|
|
165
186
|
cwd: resolveCwd(cmd),
|
|
@@ -174,7 +195,7 @@ fleet.command("accept").argument("<name>", "the registered project name").argume
|
|
|
174
195
|
"Accept a project's finding as a known trade-off \u2014 corp ledgers persist beside the manifest"
|
|
175
196
|
).option("--reason <text>", "optional note on why the trade-off is accepted").option("--manifest <file>", "the fleet manifest \u2014 required unless the cwd holds registry.json").action(
|
|
176
197
|
(name, id, _opts, cmd) => action(async () => {
|
|
177
|
-
const { accept } = await import('./fleet-
|
|
198
|
+
const { accept } = await import('./fleet-4FYZ3GBK.js');
|
|
178
199
|
const opts = cmd.optsWithGlobals();
|
|
179
200
|
await accept({ cwd: resolveCwd(cmd), manifest: opts.manifest, name, id, reason: opts.reason });
|
|
180
201
|
})
|
|
@@ -200,7 +221,7 @@ program.command("screen").description(
|
|
|
200
221
|
);
|
|
201
222
|
program.command("gates").description("Install the local git-hook gates (process \u2192 pre-commit, correctness \u2192 pre-push)").option("--ci", "note about the CI review gate (ships later; local gates install now)").option("-y, --yes", "skip prompts; never overwrites a hand-edited hook").action(
|
|
202
223
|
(opts, cmd) => action(async () => {
|
|
203
|
-
const { run } = await import('./gates-
|
|
224
|
+
const { run } = await import('./gates-IBQ7HCAN.js');
|
|
204
225
|
await run({ cwd: resolveCwd(cmd), ci: opts.ci, yes: opts.yes });
|
|
205
226
|
})
|
|
206
227
|
);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { run } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
import { run } from './chunk-CEO3BXQB.js';
|
|
3
|
+
import './chunk-2RNQ6OLV.js';
|
|
4
|
+
import './chunk-IWG77WV3.js';
|
|
4
5
|
import './chunk-3E2IPCRY.js';
|
|
5
6
|
import './chunk-HI7NWPRA.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-Y6RZRED3.js';
|
|
8
|
+
import './chunk-DBWDMIYO.js';
|
|
8
9
|
import './chunk-P6ATKV2R.js';
|
|
9
10
|
import './chunk-YQZDYDAK.js';
|
|
10
11
|
import './chunk-4VPBP6K6.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { dismiss, accept } from './chunk-HOR4M6EC.js';
|
|
3
|
-
import {
|
|
3
|
+
import { runAudit } from './chunk-2RNQ6OLV.js';
|
|
4
|
+
import { parseFailOnTier, meetsFailOn } from './chunk-IWG77WV3.js';
|
|
4
5
|
import { readLedger } from './chunk-3E2IPCRY.js';
|
|
5
6
|
import { print, theme, section, renderFleetRows, renderFleetNotes, renderFindings, TIER_BADGE, glyph } from './chunk-HI7NWPRA.js';
|
|
6
|
-
import { scanProject } from './chunk-
|
|
7
|
-
import './chunk-
|
|
7
|
+
import { scanProject } from './chunk-Y6RZRED3.js';
|
|
8
|
+
import './chunk-DBWDMIYO.js';
|
|
8
9
|
import { DEFAULT_CONFIG, ETYMD_DIR } from './chunk-P6ATKV2R.js';
|
|
9
10
|
import './chunk-YQZDYDAK.js';
|
|
10
11
|
import { readText, pathExists, git, isDirectory } from './chunk-4VPBP6K6.js';
|
|
@@ -686,7 +687,7 @@ async function checkCorpEmails(manifest, findings, disclosures) {
|
|
|
686
687
|
}
|
|
687
688
|
async function checkGateDrift(manifest, findings, disclosures) {
|
|
688
689
|
const { planWorkflow } = await import('./generate-KEX75XNG.js');
|
|
689
|
-
const { scanProject: scanProject2 } = await import('./scan-
|
|
690
|
+
const { scanProject: scanProject2 } = await import('./scan-W4US23MU.js');
|
|
690
691
|
const { readConfig } = await import('./config-724Y3IOB.js');
|
|
691
692
|
for (const entry of manifest.entries) {
|
|
692
693
|
const root = entry.resolvedRoot;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { applyFiles } from './chunk-GWGKEPRX.js';
|
|
3
3
|
import { deriveFailOn, derivedCommands, planWorkflow, runPrefix, isSafeGateCommand } from './chunk-UFNETE6P.js';
|
|
4
4
|
import { section, print, glyph, theme, renderPlan } from './chunk-HI7NWPRA.js';
|
|
5
|
-
import { scanProject } from './chunk-
|
|
6
|
-
import './chunk-
|
|
5
|
+
import { scanProject } from './chunk-Y6RZRED3.js';
|
|
6
|
+
import './chunk-DBWDMIYO.js';
|
|
7
7
|
import { readConfig, CONFIG_FILE, configPath } from './chunk-P6ATKV2R.js';
|
|
8
8
|
import './chunk-YQZDYDAK.js';
|
|
9
9
|
import { readText, git } from './chunk-4VPBP6K6.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -686,6 +686,169 @@ declare function sweepFleet(manifest: FleetManifest, opts?: FleetSweepOptions):
|
|
|
686
686
|
*/
|
|
687
687
|
declare const instructionTruthLens: Lens;
|
|
688
688
|
|
|
689
|
+
/** Everything a truth check needs from the repo, resolved once per run. */
|
|
690
|
+
interface TruthEnv {
|
|
691
|
+
root: string;
|
|
692
|
+
facts: ProjectFacts;
|
|
693
|
+
/** Package scripts across the root and every workspace manifest. */
|
|
694
|
+
knownScripts: Set<string>;
|
|
695
|
+
nodeModulesInstalled: boolean;
|
|
696
|
+
/** A manifest exists somewhere, so a script claim is checkable even without an install. */
|
|
697
|
+
manifestExists: boolean;
|
|
698
|
+
/** The root plus every workspace package dir — where claims are resolved. */
|
|
699
|
+
bases: string[];
|
|
700
|
+
/** A repo-relative claim resolves in the root, any workspace package, or their src/ scripts/. */
|
|
701
|
+
pathResolves(claim: string): Promise<boolean>;
|
|
702
|
+
/** `yarn X` / `pnpm X` may legitimately run an installed node_modules/.bin binary. */
|
|
703
|
+
binResolves(name: string): Promise<boolean>;
|
|
704
|
+
}
|
|
705
|
+
declare function buildTruthEnv(root: string, facts: ProjectFacts): Promise<TruthEnv>;
|
|
706
|
+
/** Skip-class tallies — every class a check declines to accuse is counted, then disclosed. */
|
|
707
|
+
interface ClaimCounters {
|
|
708
|
+
filteredSkipped: number;
|
|
709
|
+
tildeSkipped: number;
|
|
710
|
+
binaryResolved: number;
|
|
711
|
+
unverifiableCommands: number;
|
|
712
|
+
gitignoredSkipped: number;
|
|
713
|
+
prospectiveSkipped: number;
|
|
714
|
+
placeholderSkipped: number;
|
|
715
|
+
/** Decision references naming another record (a fleet-level ledger) — not this repo's. */
|
|
716
|
+
qualifiedRefsSkipped: number;
|
|
717
|
+
/** Decision references with no `## D-NNN` ledger to resolve against. */
|
|
718
|
+
unresolvableRefs: number;
|
|
719
|
+
}
|
|
720
|
+
declare function emptyCounters(): ClaimCounters;
|
|
721
|
+
/**
|
|
722
|
+
* One thing a check looked for, and what it found. `null` = could not be checked from the repo
|
|
723
|
+
* (counted and disclosed), never a guess. The honest-coverage half of a report: what was
|
|
724
|
+
* examined, not only what failed.
|
|
725
|
+
*/
|
|
726
|
+
interface ExaminedClaim {
|
|
727
|
+
kind: "script" | "path" | "doc" | "decision";
|
|
728
|
+
value: string;
|
|
729
|
+
exists: boolean | null;
|
|
730
|
+
}
|
|
731
|
+
/** A piece of text making claims about the repo: an instruction file, a state doc, a task. */
|
|
732
|
+
interface ClaimText {
|
|
733
|
+
/** Repo-relative path, or a label such as `task` — becomes part of every finding id. */
|
|
734
|
+
path: string;
|
|
735
|
+
text: string;
|
|
736
|
+
}
|
|
737
|
+
interface TextClaimsOptions {
|
|
738
|
+
/** The lens the findings report under (`instruction-truth`, `premise`). */
|
|
739
|
+
lensId: string;
|
|
740
|
+
/** How the text is named in a claim sentence — a file path, or "The task". */
|
|
741
|
+
subject?: string;
|
|
742
|
+
/**
|
|
743
|
+
* A missing path is `gap` for an instruction file (a dead reference among many) and `risk` for
|
|
744
|
+
* a task (the task is ABOUT the path — an agent acting on it does the wrong thing).
|
|
745
|
+
*/
|
|
746
|
+
missingPathTier: FindingTier;
|
|
747
|
+
maxPathFindings: number;
|
|
748
|
+
whyCommand?: string;
|
|
749
|
+
actionCommand?: string;
|
|
750
|
+
whyPath?: string;
|
|
751
|
+
actionPath?: string;
|
|
752
|
+
}
|
|
753
|
+
interface TextClaimsResult {
|
|
754
|
+
findings: Finding[];
|
|
755
|
+
disclosures: string[];
|
|
756
|
+
/** Every script and path claim the text made, found or not. */
|
|
757
|
+
examined: ExaminedClaim[];
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Command and path claims in one text, verified against the repo. Precision over recall: every
|
|
761
|
+
* class it declines to accuse is counted in `counters` for the caller to disclose.
|
|
762
|
+
*/
|
|
763
|
+
declare function checkTextClaims(env: TruthEnv, file: ClaimText, opts: TextClaimsOptions, counters: ClaimCounters): Promise<TextClaimsResult>;
|
|
764
|
+
interface RefsResult {
|
|
765
|
+
findings: Finding[];
|
|
766
|
+
examined: ExaminedClaim[];
|
|
767
|
+
}
|
|
768
|
+
/** Cross-references to well-known docs (AGENTS.md, CLAUDE.md, …) must resolve to real files. */
|
|
769
|
+
declare function checkDocRefs(env: TruthEnv, file: ClaimText, lensId: string, counters: ClaimCounters, subject?: string): Promise<RefsResult>;
|
|
770
|
+
/** The repo's own decision record: every `## D-NNN` id, and which files carried them. */
|
|
771
|
+
interface DecisionLedger {
|
|
772
|
+
/** Null when no decisions file with parseable `## D-NNN` entries exists. */
|
|
773
|
+
ids: Set<number> | null;
|
|
774
|
+
sources: string[];
|
|
775
|
+
}
|
|
776
|
+
declare function loadDecisionLedger(root: string, facts: ProjectFacts): Promise<DecisionLedger>;
|
|
777
|
+
interface DecisionRefsOptions {
|
|
778
|
+
lensId: string;
|
|
779
|
+
/** How the text is named in a claim sentence — a file path, or "The task". */
|
|
780
|
+
subject?: string;
|
|
781
|
+
why?: string;
|
|
782
|
+
action?: string;
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* `D-NNN` references in one text, resolved against the repo's own decision record. A citation
|
|
786
|
+
* the record cannot back is stale in a way age cannot reveal. Qualified refs (another record's)
|
|
787
|
+
* and refs with no ledger to resolve against are counted, never accused.
|
|
788
|
+
*/
|
|
789
|
+
declare function checkDecisionRefs(file: ClaimText, ledger: DecisionLedger, opts: DecisionRefsOptions, counters: ClaimCounters): RefsResult;
|
|
790
|
+
|
|
791
|
+
declare const PREMISE_LENS = "premise";
|
|
792
|
+
declare const PREMISE_BRIEF_FILE: string;
|
|
793
|
+
/** One thing the task named, found or not — the checked half of the brief. */
|
|
794
|
+
type PremiseEntity = ExaminedClaim;
|
|
795
|
+
interface PremiseResult {
|
|
796
|
+
/** The `--json` schema version. */
|
|
797
|
+
schema: "premise/1";
|
|
798
|
+
task: string;
|
|
799
|
+
/** Where the task came from: `argument`, `stdin`, or the file path it was read from. */
|
|
800
|
+
source: string;
|
|
801
|
+
/** The project name from the reckoning. */
|
|
802
|
+
name: string;
|
|
803
|
+
findings: Finding[];
|
|
804
|
+
disclosures: string[];
|
|
805
|
+
/** Everything the task named that etymd could look for — found or not. */
|
|
806
|
+
entities: PremiseEntity[];
|
|
807
|
+
brief: string;
|
|
808
|
+
/** Repo-relative path the brief was written to, or `null` when the repo never opted in. */
|
|
809
|
+
briefPath: string | null;
|
|
810
|
+
}
|
|
811
|
+
interface PremiseOptions {
|
|
812
|
+
root: string;
|
|
813
|
+
task: string;
|
|
814
|
+
source?: string;
|
|
815
|
+
/** Write the brief under `.etymd/` when that directory exists (default true). */
|
|
816
|
+
writeBrief?: boolean;
|
|
817
|
+
}
|
|
818
|
+
/** What the prose promotion declined to read as a claim — counted, then disclosed. */
|
|
819
|
+
interface PromotionSkips {
|
|
820
|
+
/** `pnpm X` / `yarn X` / `bun X` in prose without `run` — a phrase as often as an invocation. */
|
|
821
|
+
bareInvocations: number;
|
|
822
|
+
/** `… run the`, `… run X` — a function word or a one-letter stand-in where a script would be. */
|
|
823
|
+
proseScripts: number;
|
|
824
|
+
/** `github.com/org/repo/…` — a scheme-less URL, not a repo path. */
|
|
825
|
+
hostnameLike: number;
|
|
826
|
+
/** `input/output/` — a slash-joined phrase whose first segment is no directory here. */
|
|
827
|
+
unrootedDirs: number;
|
|
828
|
+
}
|
|
829
|
+
interface PromotionContext {
|
|
830
|
+
/** Directory names that exist at the root, in a workspace package, or under their src/ scripts/. */
|
|
831
|
+
rootedDirs: ReadonlySet<string>;
|
|
832
|
+
}
|
|
833
|
+
interface PromotedText {
|
|
834
|
+
text: string;
|
|
835
|
+
skips: PromotionSkips;
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* People do not backtick paths in a prompt. Promote the bare mentions the claim extractors would
|
|
839
|
+
* otherwise treat as prose — `src/x.ts`, `docs/design/`, `npm run lint` — into code spans, leaving
|
|
840
|
+
* anything already in a code span untouched. Precision over recall: only what an instruction
|
|
841
|
+
* file's extractor would accept is promoted, and every class left as prose is counted.
|
|
842
|
+
*/
|
|
843
|
+
declare function promoteBareTokens(text: string, ctx: PromotionContext): PromotedText;
|
|
844
|
+
declare function runPremise(opts: PremiseOptions): Promise<PremiseResult>;
|
|
845
|
+
/**
|
|
846
|
+
* The half of the premise check only an agent can do, written as a brief it reads before acting.
|
|
847
|
+
* Deterministic: it lists what etymd verified and hands over the three questions reading files
|
|
848
|
+
* cannot answer. It never speculates about what the task "really" means.
|
|
849
|
+
*/
|
|
850
|
+
declare function renderBrief(task: string, findings: Finding[], entities: PremiseEntity[]): string;
|
|
851
|
+
|
|
689
852
|
interface InstructionFile {
|
|
690
853
|
/** Repo-relative path. */
|
|
691
854
|
path: string;
|
|
@@ -825,4 +988,4 @@ declare const PACK_VERSION = "12";
|
|
|
825
988
|
declare const VERSION: string;
|
|
826
989
|
declare const NAME: string;
|
|
827
990
|
|
|
828
|
-
export { type ApplyResult, type ArtifactFreshness, type AuditOptions, type AuditResult, type Baseline, CONFIG_FILE, type ContextBudget, type ContextBudgets, type ContextFile, DECISIONS_FORMAT_MARKER, DEFAULT_CONFIG, type DetectedArtifact, type DiscoveredCommands, EXTRACTION_THRESHOLD, type EtymdConfig, FLEET_JSON_SCHEMA, FLEET_LENS, type Finding, type FleetContract, type FleetEntry, type FleetManifest, type FleetProfile, type FleetProjectSweep, type FleetSweepOptions, type FleetSweepResult, type FreshnessFacts, type GateInventory, type GateTool, type GeneratedFile, type HookFacts, type InstructionFileSet, type InstructionScope, LENSES, type Ledger, type LedgerDiff, type LedgerEntry, type Lens, type LensReport, type LoadedConfig, type ManifestProblem, NAME, PACK_VERSION, type PackageManager, type PathClaims, type PlanOptions, type ProjectFacts, type StateBudgets, TOTAL_BUDGET_WORDS, VERSION, type WorkflowProfile, type WorkspaceKind, applyFiles, baselineCarriesMachinePath, baselinePath, buildGateInventory, cacheFactsPath, checkManifest, collectWallFindings, configPath, contextEconomyLens, corpPersistenceRoot, deriveProfile, expandTilde, extractCommandClaims, extractPathClaims, gateIntegrityLens, instructionTruthLens, isAlwaysAppliedCursorRule, listInstructionFiles, loadFleetManifest, measureContext, planWorkflow, rankFindings, readBaseline, readCachedFacts, readConfig, readLedger, reconcileLedger, runAudit, scanProject, stateFreshnessLens, sweepFleet, withoutMachinePath, writeBaseline, writeCachedFacts, writeLedger };
|
|
991
|
+
export { type ApplyResult, type ArtifactFreshness, type AuditOptions, type AuditResult, type Baseline, CONFIG_FILE, type ClaimCounters, type ClaimText, type ContextBudget, type ContextBudgets, type ContextFile, DECISIONS_FORMAT_MARKER, DEFAULT_CONFIG, type DecisionLedger, type DecisionRefsOptions, type DetectedArtifact, type DiscoveredCommands, EXTRACTION_THRESHOLD, type EtymdConfig, type ExaminedClaim, FLEET_JSON_SCHEMA, FLEET_LENS, type Finding, type FleetContract, type FleetEntry, type FleetManifest, type FleetProfile, type FleetProjectSweep, type FleetSweepOptions, type FleetSweepResult, type FreshnessFacts, type GateInventory, type GateTool, type GeneratedFile, type HookFacts, type InstructionFileSet, type InstructionScope, LENSES, type Ledger, type LedgerDiff, type LedgerEntry, type Lens, type LensReport, type LoadedConfig, type ManifestProblem, NAME, PACK_VERSION, PREMISE_BRIEF_FILE, PREMISE_LENS, type PackageManager, type PathClaims, type PlanOptions, type PremiseEntity, type PremiseOptions, type PremiseResult, type ProjectFacts, type PromotedText, type PromotionContext, type PromotionSkips, type RefsResult, type StateBudgets, TOTAL_BUDGET_WORDS, type TextClaimsOptions, type TextClaimsResult, type TruthEnv, VERSION, type WorkflowProfile, type WorkspaceKind, applyFiles, baselineCarriesMachinePath, baselinePath, buildGateInventory, buildTruthEnv, cacheFactsPath, checkDecisionRefs, checkDocRefs, checkManifest, checkTextClaims, collectWallFindings, configPath, contextEconomyLens, corpPersistenceRoot, deriveProfile, emptyCounters, expandTilde, extractCommandClaims, extractPathClaims, gateIntegrityLens, instructionTruthLens, isAlwaysAppliedCursorRule, listInstructionFiles, loadDecisionLedger, loadFleetManifest, measureContext, planWorkflow, promoteBareTokens, rankFindings, readBaseline, readCachedFacts, readConfig, readLedger, reconcileLedger, renderBrief, runAudit, runPremise, scanProject, stateFreshnessLens, sweepFleet, withoutMachinePath, writeBaseline, writeCachedFacts, writeLedger };
|