@mmnto/cli 1.118.0 → 1.119.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/dist/adapters/github-cli-project.d.ts +4 -2
- package/dist/adapters/github-cli-project.d.ts.map +1 -1
- package/dist/adapters/github-cli-project.js +26 -3
- package/dist/adapters/github-cli-project.js.map +1 -1
- package/dist/adapters/github-cli-project.test.d.ts +2 -0
- package/dist/adapters/github-cli-project.test.d.ts.map +1 -0
- package/dist/adapters/github-cli-project.test.js +80 -0
- package/dist/adapters/github-cli-project.test.js.map +1 -0
- package/dist/authored-rule-intake-prewindow.test.js +22 -10
- package/dist/authored-rule-intake-prewindow.test.js.map +1 -1
- package/dist/authored-rule-intake.d.ts +50 -1
- package/dist/authored-rule-intake.d.ts.map +1 -1
- package/dist/authored-rule-intake.js +311 -22
- package/dist/authored-rule-intake.js.map +1 -1
- package/dist/commands/compile-noop-refresh.test.js +86 -1
- package/dist/commands/compile-noop-refresh.test.js.map +1 -1
- package/dist/commands/compile-refresh-manifest.test.js +38 -0
- package/dist/commands/compile-refresh-manifest.test.js.map +1 -1
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +33 -6
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.d.ts +10 -2
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +22 -5
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/doctor.test.js +62 -0
- package/dist/commands/doctor.test.js.map +1 -1
- package/dist/commands/lesson-archive.test.js +26 -1
- package/dist/commands/lesson-archive.test.js.map +1 -1
- package/dist/commands/lesson.d.ts.map +1 -1
- package/dist/commands/lesson.js +4 -1
- package/dist/commands/lesson.js.map +1 -1
- package/dist/commands/orient.test.js +21 -0
- package/dist/commands/orient.test.js.map +1 -1
- package/dist/commands/rule-author-command.test.js +15 -7
- package/dist/commands/rule-author-command.test.js.map +1 -1
- package/dist/commands/rule-author.test.js +584 -47
- package/dist/commands/rule-author.test.js.map +1 -1
- package/dist/commands/rule.d.ts.map +1 -1
- package/dist/commands/rule.js +67 -2
- package/dist/commands/rule.js.map +1 -1
- package/dist/commands/rule.test.js +128 -0
- package/dist/commands/rule.test.js.map +1 -1
- package/dist/commands/run-compiled-rules.d.ts.map +1 -1
- package/dist/commands/run-compiled-rules.js +54 -31
- package/dist/commands/run-compiled-rules.js.map +1 -1
- package/dist/commands/run-compiled-rules.test.js +100 -5
- package/dist/commands/run-compiled-rules.test.js.map +1 -1
- package/dist/commands/shield.d.ts.map +1 -1
- package/dist/commands/shield.js +3 -1
- package/dist/commands/shield.js.map +1 -1
- package/dist/commands/shield.test.js +50 -0
- package/dist/commands/shield.test.js.map +1 -1
- package/dist/commands/spine-authored-cert-corpus.d.ts.map +1 -1
- package/dist/commands/spine-authored-cert-corpus.js +5 -1
- package/dist/commands/spine-authored-cert-corpus.js.map +1 -1
- package/dist/commands/spine-authored-cert-corpus.test.js +50 -29
- package/dist/commands/spine-authored-cert-corpus.test.js.map +1 -1
- package/dist/commands/spine-corpus-disposition-source.d.ts +2 -2
- package/dist/commands/spine-freeze-orchestration.test.js +19 -21
- package/dist/commands/spine-freeze-orchestration.test.js.map +1 -1
- package/dist/commands/verify-manifest.d.ts.map +1 -1
- package/dist/commands/verify-manifest.js +59 -9
- package/dist/commands/verify-manifest.js.map +1 -1
- package/dist/commands/verify-manifest.test.js +243 -3
- package/dist/commands/verify-manifest.test.js.map +1 -1
- package/package.json +2 -2
|
@@ -14,8 +14,10 @@ export interface BoardItem {
|
|
|
14
14
|
* Read the in-flight items of a GH Project board for `owner` / `projectNumber`.
|
|
15
15
|
*
|
|
16
16
|
* Throws (via `ghFetchAndParse` → `handleGhError`) when the board is
|
|
17
|
-
* inaccessible / the project is absent / the JSON shape is unexpected
|
|
18
|
-
*
|
|
17
|
+
* inaccessible / the project is absent / the JSON shape is unexpected — and
|
|
18
|
+
* directly when the response is truncated (`items.length < totalCount`,
|
|
19
|
+
* mmnto-ai/totem#2644); the `orient` command catches that and renders a
|
|
20
|
+
* per-section `{ error }` envelope.
|
|
19
21
|
*/
|
|
20
22
|
export declare function fetchBoardItems(owner: string, projectNumber: number, cwd: string): BoardItem[];
|
|
21
23
|
//# sourceMappingURL=github-cli-project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-cli-project.d.ts","sourceRoot":"","sources":["../../src/adapters/github-cli-project.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-cli-project.d.ts","sourceRoot":"","sources":["../../src/adapters/github-cli-project.ts"],"names":[],"mappings":"AAoDA,yFAAyF;AACzF,MAAM,WAAW,SAAS;IACxB,iGAAiG;IACjG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kGAAkG;IAClG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AASD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,CAuC9F"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// totem-context: fetchBoardItems is synchronous — ghFetchAndParse uses safeExec (sync). Do not flag missing await.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { TotemError } from '@mmnto/totem';
|
|
3
4
|
import { ghFetchAndParse } from './gh-utils.js';
|
|
4
5
|
// ─── Board (GH Project) reader ──────────────────────────
|
|
5
6
|
//
|
|
@@ -33,18 +34,29 @@ const GhProjectItemSchema = z
|
|
|
33
34
|
.optional(),
|
|
34
35
|
})
|
|
35
36
|
.passthrough();
|
|
37
|
+
// `totalCount` is the board's full card count regardless of `--limit` — the
|
|
38
|
+
// truncation signal the #2644 guard compares against. Optional: older gh
|
|
39
|
+
// versions omit it, and without it there is no signal to check.
|
|
36
40
|
const GhProjectItemListSchema = z
|
|
37
41
|
.object({
|
|
38
42
|
items: z.array(GhProjectItemSchema),
|
|
43
|
+
totalCount: z.number().optional(),
|
|
39
44
|
})
|
|
40
45
|
.passthrough();
|
|
41
|
-
|
|
46
|
+
// Deliberately-complete page budget (mmnto-ai/totem#2644): the previous 200
|
|
47
|
+
// silently truncated >200-card boards — active tail cards vanished and the
|
|
48
|
+
// board section read as complete. `gh` paginates up to `--limit` and stops at
|
|
49
|
+
// the board's real card count, so a high limit costs nothing on small boards;
|
|
50
|
+
// the totalCount guard below keeps any board past this budget loud.
|
|
51
|
+
const BOARD_ITEM_LIMIT = 1000;
|
|
42
52
|
/**
|
|
43
53
|
* Read the in-flight items of a GH Project board for `owner` / `projectNumber`.
|
|
44
54
|
*
|
|
45
55
|
* Throws (via `ghFetchAndParse` → `handleGhError`) when the board is
|
|
46
|
-
* inaccessible / the project is absent / the JSON shape is unexpected
|
|
47
|
-
*
|
|
56
|
+
* inaccessible / the project is absent / the JSON shape is unexpected — and
|
|
57
|
+
* directly when the response is truncated (`items.length < totalCount`,
|
|
58
|
+
* mmnto-ai/totem#2644); the `orient` command catches that and renders a
|
|
59
|
+
* per-section `{ error }` envelope.
|
|
48
60
|
*/
|
|
49
61
|
export function fetchBoardItems(owner, projectNumber, cwd) {
|
|
50
62
|
const parsed = ghFetchAndParse([
|
|
@@ -58,6 +70,17 @@ export function fetchBoardItems(owner, projectNumber, cwd) {
|
|
|
58
70
|
'--limit',
|
|
59
71
|
String(BOARD_ITEM_LIMIT),
|
|
60
72
|
], GhProjectItemListSchema, `GH Project board ${owner}/${projectNumber}`, cwd);
|
|
73
|
+
// Truncation guard (Tenet 4, mmnto-ai/totem#2644): the board section presents
|
|
74
|
+
// itself as the full in-flight set, so a short fetch must never read as
|
|
75
|
+
// completeness — fail loud into the caller's { error } envelope instead.
|
|
76
|
+
if (parsed.totalCount !== undefined && parsed.items.length < parsed.totalCount) {
|
|
77
|
+
// 'SHIELD_FAILED' is this adapter's existing fetch-failure code (the
|
|
78
|
+
// handleGhError fallthrough). The remediation stays in the message too:
|
|
79
|
+
// orient's { error } envelope surfaces .message only, never recoveryHint.
|
|
80
|
+
throw new TotemError('SHIELD_FAILED', `GH Project board ${owner}/${projectNumber} truncated: fetched ${parsed.items.length} of ` +
|
|
81
|
+
`${parsed.totalCount} cards (--limit ${BOARD_ITEM_LIMIT}) — raise BOARD_ITEM_LIMIT; ` +
|
|
82
|
+
`a partial board must not derive orientation`, 'Raise BOARD_ITEM_LIMIT in github-cli-project.ts so one fetch covers the whole board, then re-run `totem orient`.');
|
|
83
|
+
}
|
|
61
84
|
return parsed.items.map((i) => ({
|
|
62
85
|
status: i.status,
|
|
63
86
|
title: i.title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-cli-project.js","sourceRoot":"","sources":["../../src/adapters/github-cli-project.ts"],"names":[],"mappings":"AAAA,mHAAmH;AAEnH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,2DAA2D;AAC3D,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,gEAAgE;AAChE,6EAA6E;AAC7E,0EAA0E;AAC1E,wEAAwE;AACxE,YAAY;AAEZ,yEAAyE;AACzE,8EAA8E;AAC9E,yEAAyE;AACzE,sEAAsE;AACtE,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,2EAA2E;AAC3E,MAAM,mBAAmB,GAAG,CAAC;KAC1B,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC;SACP,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,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,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9B,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM;QAChC,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,UAAU;QAClC,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI;KAC7B,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-cli-project.test.d.ts","sourceRoot":"","sources":["../../src/adapters/github-cli-project.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { safeExec, TotemError } from '@mmnto/totem';
|
|
3
|
+
import { fetchBoardItems } from './github-cli-project.js';
|
|
4
|
+
// Mock `safeExec` at the `@mmnto/totem` boundary (same rationale as
|
|
5
|
+
// gh-utils.test.ts): these tests verify the adapter's call signature and
|
|
6
|
+
// parsing contract, not safeExec's passthrough layer.
|
|
7
|
+
vi.mock('@mmnto/totem', async () => {
|
|
8
|
+
const actual = await vi.importActual('@mmnto/totem');
|
|
9
|
+
return {
|
|
10
|
+
...actual,
|
|
11
|
+
safeExec: vi.fn(),
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
const mockedExec = vi.mocked(safeExec);
|
|
15
|
+
/**
|
|
16
|
+
* Build a `gh project item-list --format json` response of `count` cards.
|
|
17
|
+
* The TAIL card (the one a 200-capped fetch would drop, mmnto-ai/totem#2644)
|
|
18
|
+
* is an active In Progress issue card; one mid-board card is a draft card
|
|
19
|
+
* with no `content` (the shape gh emits for drafts).
|
|
20
|
+
*/
|
|
21
|
+
function boardResponse(count, totalCount) {
|
|
22
|
+
const items = Array.from({ length: count }, (_, idx) => {
|
|
23
|
+
const n = idx + 1;
|
|
24
|
+
if (n === 3) {
|
|
25
|
+
// Draft card: no linked content at all.
|
|
26
|
+
return { status: 'Todo', title: `draft card ${n}` };
|
|
27
|
+
}
|
|
28
|
+
const isTail = n === count;
|
|
29
|
+
return {
|
|
30
|
+
status: isTail ? 'In Progress' : 'Done',
|
|
31
|
+
title: `card ${n}`,
|
|
32
|
+
content: { number: n, repository: 'mmnto-ai/totem', type: 'Issue' },
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
return JSON.stringify(totalCount === undefined ? { items } : { items, totalCount });
|
|
36
|
+
}
|
|
37
|
+
describe('fetchBoardItems', () => {
|
|
38
|
+
beforeEach(() => {
|
|
39
|
+
mockedExec.mockReset();
|
|
40
|
+
});
|
|
41
|
+
it('requests a deliberately complete --limit (not the old 200 cap)', () => {
|
|
42
|
+
mockedExec.mockReturnValue(boardResponse(5, 5));
|
|
43
|
+
fetchBoardItems('mmnto-ai', 1, '/repo');
|
|
44
|
+
const args = mockedExec.mock.calls[0]?.[1];
|
|
45
|
+
const limitValue = args[args.indexOf('--limit') + 1];
|
|
46
|
+
// Pinned on purpose: changing the page budget must be a conscious edit here
|
|
47
|
+
// too — the fixture below only proves completeness up to this budget.
|
|
48
|
+
expect(limitValue).toBe('1000');
|
|
49
|
+
});
|
|
50
|
+
it('parses a >200-card board in full — the active tail card survives (#2644)', () => {
|
|
51
|
+
mockedExec.mockReturnValue(boardResponse(227, 227));
|
|
52
|
+
const items = fetchBoardItems('mmnto-ai', 1, '/repo');
|
|
53
|
+
expect(items).toHaveLength(227);
|
|
54
|
+
const tail = items[226];
|
|
55
|
+
expect(tail).toMatchObject({
|
|
56
|
+
status: 'In Progress',
|
|
57
|
+
title: 'card 227',
|
|
58
|
+
contentNumber: 227,
|
|
59
|
+
contentRepo: 'mmnto-ai/totem',
|
|
60
|
+
contentType: 'Issue',
|
|
61
|
+
});
|
|
62
|
+
// Draft card maps with all content fields honestly absent.
|
|
63
|
+
expect(items[2]).toMatchObject({ title: 'draft card 3' });
|
|
64
|
+
expect(items[2].contentNumber).toBeUndefined();
|
|
65
|
+
expect(items[2].contentType).toBeUndefined();
|
|
66
|
+
});
|
|
67
|
+
it('fails loud when the response is truncated (items < totalCount)', () => {
|
|
68
|
+
mockedExec.mockReturnValue(boardResponse(3, 227));
|
|
69
|
+
expect(() => fetchBoardItems('mmnto-ai', 1, '/repo')).toThrow(/truncated: fetched 3 of 227 cards/);
|
|
70
|
+
// Layer idiom (PR #2646 GCA round): the guard throws the adapter's
|
|
71
|
+
// structured error type, same family as every other fetch failure here.
|
|
72
|
+
expect(() => fetchBoardItems('mmnto-ai', 1, '/repo')).toThrow(TotemError);
|
|
73
|
+
});
|
|
74
|
+
it('tolerates an absent totalCount (older gh) — no truncation signal, no throw', () => {
|
|
75
|
+
mockedExec.mockReturnValue(boardResponse(2));
|
|
76
|
+
const items = fetchBoardItems('mmnto-ai', 1, '/repo');
|
|
77
|
+
expect(items).toHaveLength(2);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=github-cli-project.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-cli-project.test.js","sourceRoot":"","sources":["../../src/adapters/github-cli-project.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,oEAAoE;AACpE,yEAAyE;AACzE,sDAAsD;AACtD,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE;IACjC,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,YAAY,CAAgC,cAAc,CAAC,CAAC;IACpF,OAAO;QACL,GAAG,MAAM;QACT,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE;KAClB,C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,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QAClD,MAAM,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAC3D,mCAAmC,CACpC,CAAC;QACF,mEAAmE;QACnE,wEAAwE;QACxE,MAAM,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4EAA4E,EAAE,GAAG,EAAE;QACpF,UAAU,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,KAAK,GAAG,eAAe,CAAC,UAAU,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;QACtD,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -16,26 +16,39 @@ const artifact = {
|
|
|
16
16
|
split: { trainPrs: [447, 601], heldOutPrs: [602, 697] },
|
|
17
17
|
};
|
|
18
18
|
let root;
|
|
19
|
+
let totemDir;
|
|
20
|
+
// Prop 310 § Design 1: the rule half lives in a record file the envelope
|
|
21
|
+
// REFERENCES. The §5.2 gate reads `positiveFixtures[].pr`, which is unchanged.
|
|
22
|
+
const RECORD_REF = '.totem/rules/no-console-log.rule.yaml';
|
|
19
23
|
beforeEach(() => {
|
|
20
24
|
root = fs.mkdtempSync(path.join(os.tmpdir(), 'totem-intake-prewindow-'));
|
|
21
|
-
|
|
25
|
+
totemDir = path.join(root, '.totem');
|
|
26
|
+
fs.mkdirSync(path.join(totemDir, 'spine'), { recursive: true });
|
|
27
|
+
fs.mkdirSync(path.join(totemDir, 'rules'), { recursive: true });
|
|
28
|
+
fs.writeFileSync(path.join(totemDir, 'rules', 'no-console-log.rule.yaml'), yamlStringify({
|
|
29
|
+
schemaVersion: 1,
|
|
30
|
+
severity: 'warning',
|
|
31
|
+
message: 'console.log is banned in production code.',
|
|
32
|
+
target: {
|
|
33
|
+
type: 'regex',
|
|
34
|
+
pattern: 'console\\.log',
|
|
35
|
+
scope: { fileGlobs: ['src/**/*.rs'] },
|
|
36
|
+
},
|
|
37
|
+
examples: [{ bad: 'console.log("dbg")', good: 'logger.debug("dbg")' }],
|
|
38
|
+
}), 'utf-8');
|
|
22
39
|
});
|
|
23
40
|
afterEach(() => {
|
|
24
41
|
fs.rmSync(root, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
25
42
|
});
|
|
26
43
|
const fixture = (pr) => ({
|
|
27
44
|
pr,
|
|
28
|
-
preimageSource: {
|
|
29
|
-
kind: 'commit',
|
|
30
|
-
preimageCommitSha: 'b'.repeat(40),
|
|
31
|
-
mergeCommitSha: 'a'.repeat(40),
|
|
32
|
-
},
|
|
33
45
|
filePath: 'src/x.rs',
|
|
34
46
|
matchedSpan: 'L1',
|
|
35
47
|
contentHash: 'h'.repeat(8),
|
|
48
|
+
example: 0,
|
|
36
49
|
});
|
|
37
50
|
const writeYaml = (fixturePr) => {
|
|
38
|
-
fs.writeFileSync(path.join(
|
|
51
|
+
fs.writeFileSync(path.join(totemDir, 'spine', 'authored-rules.yaml'), yamlStringify({
|
|
39
52
|
splitRef: SPLIT_REF,
|
|
40
53
|
freezeCommitment: COMMITMENT,
|
|
41
54
|
authoredAfterSplit: true,
|
|
@@ -45,15 +58,14 @@ const writeYaml = (fixturePr) => {
|
|
|
45
58
|
author: 'alice',
|
|
46
59
|
authoredAt: '2026-07-04',
|
|
47
60
|
targetDefect: 'forbidden console.log',
|
|
48
|
-
declaredEngine: 'regex',
|
|
49
61
|
structuralClass: 'forbidden-literal-token',
|
|
50
|
-
|
|
62
|
+
record: RECORD_REF,
|
|
51
63
|
positiveFixtures: [fixture(fixturePr)],
|
|
52
64
|
},
|
|
53
65
|
],
|
|
54
66
|
}), 'utf-8');
|
|
55
67
|
};
|
|
56
|
-
const run = (verified) => runRuleAuthor(
|
|
68
|
+
const run = (verified) => runRuleAuthor(totemDir, {
|
|
57
69
|
judgedBy: 'static-whitelist@cert-1',
|
|
58
70
|
freezeBinding: { artifact },
|
|
59
71
|
...(verified !== undefined ? { verifiedPreWindowFixturePrs: verified } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authored-rule-intake-prewindow.test.js","sourceRoot":"","sources":["../src/authored-rule-intake-prewindow.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAIlD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,oFAAoF;AACpF,kFAAkF;AAClF,4EAA4E;AAE5E,MAAM,SAAS,GAAG,SAAS,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;AAC5C,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAElC,uFAAuF;AACvF,MAAM,QAAQ,GAAG;IACf,QAAQ,EAAE,SAAS;IACnB,gBAAgB,EAAE,UAAU;IAC5B,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;CACtB,CAAC;AAEpC,IAAI,IAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"authored-rule-intake-prewindow.test.js","sourceRoot":"","sources":["../src/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E,GAAG,EAAE;QAChG,SAAS,CAAC,GAAG,CAAC,CAAC;QACf,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2FAA2F,EAAE,GAAG,EAAE;QACnG,SAAS,CAAC,GAAG,CAAC,CAAC;QACf,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,55 @@
|
|
|
1
|
-
import { type AuthoredRuleRecord, type FrozenSplitArtifact } from '@mmnto/totem';
|
|
1
|
+
import { type AuthoredFixture, type AuthoredRuleInput, type AuthoredRuleRecord, type FrozenSplitArtifact, type ParsedRuleRecord } from '@mmnto/totem';
|
|
2
2
|
/** `.totem`-relative path to the authoring input. */
|
|
3
3
|
export declare const AUTHORED_RULES_REL: string;
|
|
4
|
+
/** One ingested record: the resolved path, its LF-admitted content hash, and slice 1's parse. */
|
|
5
|
+
export interface IngestedRecord {
|
|
6
|
+
/** The reference exactly as the envelope wrote it — informational, never identity. */
|
|
7
|
+
path: string;
|
|
8
|
+
/** sha256 of the LF-admitted bytes — what every §8 attestation binds to. */
|
|
9
|
+
contentHash: string;
|
|
10
|
+
parsed: ParsedRuleRecord;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The closed set of § Design 1 shape rules an envelope `record:` reference can
|
|
14
|
+
* violate. A runtime value, not a bare union, so the test table can assert every
|
|
15
|
+
* rule has a negative fixture — the same discipline `GLOB_DIALECT_RULES` applies
|
|
16
|
+
* on the record-grammar side.
|
|
17
|
+
*/
|
|
18
|
+
export declare const RECORD_REFERENCE_RULES: readonly ["separator", "absolute-path", "drive-letter", "unc-path", "empty-segment", "current-segment", "parent-segment", "records-dir-prefix", "suffix", "is-the-records-dir"];
|
|
19
|
+
export type RecordReferenceRule = (typeof RECORD_REFERENCE_RULES)[number];
|
|
20
|
+
/**
|
|
21
|
+
* LEXICAL validation of a `record:` reference — pure string rules over the value
|
|
22
|
+
* as written, run BEFORE any path resolution.
|
|
23
|
+
*
|
|
24
|
+
* Why lexical and why first (falsification leg MIN-2): `path.resolve` +
|
|
25
|
+
* `path.relative` reach the same verdict for a POSIX-clean reference on every
|
|
26
|
+
* platform, but they DIVERGE on the malformed ones. On win32 a backslash is a
|
|
27
|
+
* separator and on linux it is a filename character; a drive-letter absolute that
|
|
28
|
+
* happens to land inside the root passes containment; `//` collapses; and the
|
|
29
|
+
* default filesystem case-insensitivity lets `.totem/Rules/x.rule.yaml` resolve
|
|
30
|
+
* into the real directory on Windows and fail on linux. The reference is also
|
|
31
|
+
* recorded VERBATIM in the tracked `authoring-ledger.ndjson`, so an accepted
|
|
32
|
+
* absolute or backslashed form would commit a machine-specific path into a shared
|
|
33
|
+
* attestation. These rules give one verdict on both platforms, on the text.
|
|
34
|
+
*
|
|
35
|
+
* Returns the violated rule, or `null` when the reference is well-formed. The
|
|
36
|
+
* resolved-containment check in `resolveRecordPath` stays as the second line of
|
|
37
|
+
* defence.
|
|
38
|
+
*/
|
|
39
|
+
export declare function checkRecordReference(totemDirName: string, reference: string): RecordReferenceRule | null;
|
|
40
|
+
/**
|
|
41
|
+
* Prop 310 § Design 10 / Amendment 1 — DERIVE each positive fixture's
|
|
42
|
+
* `preimageSource` from the record's `examples[ordinal]`, keyed `(ruleId, ordinal)`
|
|
43
|
+
* with the CR-blind pair hash as drift sensor.
|
|
44
|
+
*
|
|
45
|
+
* Called AFTER the identity is resolved, because the derived key carries the real
|
|
46
|
+
* minted `ruleId` — deriving before the mint would anchor the pair to a placeholder.
|
|
47
|
+
* A dangling ordinal and a duplicate ordinal both fail LOUD naming the rule and the
|
|
48
|
+
* ordinal ("a dangling, duplicate, or hash-mismatched reference fails loud at
|
|
49
|
+
* intake — never a silent re-pair"); the hash-mismatch leg is the ledger's own
|
|
50
|
+
* `contentHash` comparison, which needs no second mechanism.
|
|
51
|
+
*/
|
|
52
|
+
export declare function deriveRecordFixtures(rule: AuthoredRuleInput, ingested: IngestedRecord, ruleId: string): AuthoredFixture[];
|
|
4
53
|
/** A rule the whitelist could not decide — recorded, not minted, not ledgered (no record reaches compile). */
|
|
5
54
|
export interface RejectedAuthoredRule {
|
|
6
55
|
author: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authored-rule-intake.d.ts","sourceRoot":"","sources":["../src/authored-rule-intake.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authored-rule-intake.d.ts","sourceRoot":"","sources":["../src/authored-rule-intake.ts"],"names":[],"mappings":"AAkCA,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAOvB,KAAK,mBAAmB,EAGxB,KAAK,gBAAgB,EAQtB,MAAM,cAAc,CAAC;AAItB,qDAAqD;AACrD,eAAO,MAAM,kBAAkB,QAA4C,CAAC;AAkG5E,iGAAiG;AACjG,MAAM,WAAW,cAAc;IAC7B,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,iLAWzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,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