@gtrabanco/agentic-workflow-schema 4.9.0 → 5.0.0-canary.20261102.1
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/README.md +1 -1
- package/dist/file-schemas.d.ts +62 -0
- package/dist/file-schemas.js +89 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +146 -12
- package/dist/paths.d.ts +28 -0
- package/dist/paths.js +28 -0
- package/dist/pre-execution-vectors.js +5 -1
- package/dist/pre-execution.d.ts +5 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -148,7 +148,7 @@ const result = compileWorkflowSnapshot({
|
|
|
148
148
|
repository: { branch, headSha, dirty },
|
|
149
149
|
documents: [
|
|
150
150
|
{ path: "docs/workflow/REPOSITORY_STATE.md", content: repositoryState },
|
|
151
|
-
{ path: "docs/
|
|
151
|
+
{ path: "docs/ROADMAP.md", content: roadmap },
|
|
152
152
|
{ path: "docs/features/12-machine-contract/SPEC.md", content: spec },
|
|
153
153
|
{ path: "docs/features/12-machine-contract/progress.md", content: progress },
|
|
154
154
|
],
|
package/dist/file-schemas.d.ts
CHANGED
|
@@ -17,6 +17,68 @@
|
|
|
17
17
|
* @type {readonly ["AC", "What was run", "Exit / digest", "Output (≤2 lines)", "Verified-by"]}
|
|
18
18
|
*/
|
|
19
19
|
export declare const EVIDENCE_COLUMNS: readonly ["AC", "What was run", "Exit / digest", "Output (≤2 lines)", "Verified-by"];
|
|
20
|
+
/**
|
|
21
|
+
* The `claim | command | output | status` row a repair introduces for every
|
|
22
|
+
* claim it makes. `fold-findings` and `execute-phase` mandate it in prose; this
|
|
23
|
+
* is the versioned shape a driver can check, so "paste the command, never type
|
|
24
|
+
* the result" stops being a request a model may skip.
|
|
25
|
+
*
|
|
26
|
+
* @type {readonly ["claim", "command", "output", "status"]}
|
|
27
|
+
*/
|
|
28
|
+
export declare const EVIDENCE_ROW_COLUMNS: readonly ["claim", "command", "output", "status"];
|
|
29
|
+
/**
|
|
30
|
+
* The closed verdict set: a row either verifies or it does not. A `✗` row means
|
|
31
|
+
* the turn is not done, which is why the vocabulary is closed rather than free
|
|
32
|
+
* text (`yes`/`PASS`/`ok` are refused, never coerced).
|
|
33
|
+
*
|
|
34
|
+
* @type {readonly ["✓", "✗"]}
|
|
35
|
+
*/
|
|
36
|
+
export declare const EVIDENCE_ROW_VERDICTS: readonly ["✓", "✗"];
|
|
37
|
+
/**
|
|
38
|
+
* Classify a markdown line against `evidence-row@1`: a header, a separator, a
|
|
39
|
+
* claim row (with its parsed cells and refuse-nothing shape), or something else.
|
|
40
|
+
*
|
|
41
|
+
* @param {string} line
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseEvidenceRow(line: string): {
|
|
44
|
+
kind: string;
|
|
45
|
+
ok: boolean;
|
|
46
|
+
cells: null;
|
|
47
|
+
violations: never[];
|
|
48
|
+
} | {
|
|
49
|
+
kind: string;
|
|
50
|
+
ok: boolean;
|
|
51
|
+
cells: {
|
|
52
|
+
claim: string;
|
|
53
|
+
command: string;
|
|
54
|
+
output: string;
|
|
55
|
+
status: string;
|
|
56
|
+
};
|
|
57
|
+
violations: string[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Validate one line against `evidence-row@1`. A header or separator is not a
|
|
61
|
+
* claim and passes; a non-table line is not a row of this grammar either.
|
|
62
|
+
*
|
|
63
|
+
* @param {string} line
|
|
64
|
+
* @returns {{ ok: boolean, kind: string, cells: object|null, violations: string[] }}
|
|
65
|
+
*/
|
|
66
|
+
export declare function validateEvidenceRow(line: string): {
|
|
67
|
+
kind: string;
|
|
68
|
+
ok: boolean;
|
|
69
|
+
cells: {
|
|
70
|
+
claim: string;
|
|
71
|
+
command: string;
|
|
72
|
+
output: string;
|
|
73
|
+
status: string;
|
|
74
|
+
};
|
|
75
|
+
violations: string[];
|
|
76
|
+
} | {
|
|
77
|
+
kind: string;
|
|
78
|
+
cells: null;
|
|
79
|
+
ok: boolean;
|
|
80
|
+
violations: string[];
|
|
81
|
+
};
|
|
20
82
|
export declare const PROGRESS_ENTRY_PATTERN: RegExp;
|
|
21
83
|
/**
|
|
22
84
|
* @type {readonly ["NN", "slug", "status", "depends-on", "description"]}
|
package/dist/file-schemas.js
CHANGED
|
@@ -27,6 +27,95 @@ export const EVIDENCE_COLUMNS = [
|
|
|
27
27
|
"Output (≤2 lines)",
|
|
28
28
|
"Verified-by",
|
|
29
29
|
];
|
|
30
|
+
// ── Unit doc: claim-evidence row grammar (evidence-row@1, #318 S5/S12) ───
|
|
31
|
+
/**
|
|
32
|
+
* The `claim | command | output | status` row a repair introduces for every
|
|
33
|
+
* claim it makes. `fold-findings` and `execute-phase` mandate it in prose; this
|
|
34
|
+
* is the versioned shape a driver can check, so "paste the command, never type
|
|
35
|
+
* the result" stops being a request a model may skip.
|
|
36
|
+
*
|
|
37
|
+
* @type {readonly ["claim", "command", "output", "status"]}
|
|
38
|
+
*/
|
|
39
|
+
export const EVIDENCE_ROW_COLUMNS = ["claim", "command", "output", "status"];
|
|
40
|
+
/**
|
|
41
|
+
* The closed verdict set: a row either verifies or it does not. A `✗` row means
|
|
42
|
+
* the turn is not done, which is why the vocabulary is closed rather than free
|
|
43
|
+
* text (`yes`/`PASS`/`ok` are refused, never coerced).
|
|
44
|
+
*
|
|
45
|
+
* @type {readonly ["✓", "✗"]}
|
|
46
|
+
*/
|
|
47
|
+
export const EVIDENCE_ROW_VERDICTS = ["✓", "✗"];
|
|
48
|
+
const EVIDENCE_ROW_BACKTICK = /`[^`]+`/;
|
|
49
|
+
const EVIDENCE_ROW_SEPARATOR = /^\|(?:\s*:?-{3,}:?\s*\|)+$/;
|
|
50
|
+
/** Split a markdown table line into its cells, dropping the outer pipes. */
|
|
51
|
+
function evidenceRowCells(line) {
|
|
52
|
+
const text = line.trim();
|
|
53
|
+
if (!text.startsWith("|"))
|
|
54
|
+
return null;
|
|
55
|
+
const cells = text.split("|").slice(1);
|
|
56
|
+
if (cells.length && cells[cells.length - 1].trim() === "")
|
|
57
|
+
cells.pop();
|
|
58
|
+
return cells.map((cell) => cell.trim());
|
|
59
|
+
}
|
|
60
|
+
/** The cell with its wrapping backticks removed, or null when it carries none. */
|
|
61
|
+
function backticked(cell) {
|
|
62
|
+
if (!EVIDENCE_ROW_BACKTICK.test(cell))
|
|
63
|
+
return null;
|
|
64
|
+
return cell.replace(/^`(.*)`$/s, "$1");
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Classify a markdown line against `evidence-row@1`: a header, a separator, a
|
|
68
|
+
* claim row (with its parsed cells and refuse-nothing shape), or something else.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} line
|
|
71
|
+
*/
|
|
72
|
+
export function parseEvidenceRow(line) {
|
|
73
|
+
const cells = evidenceRowCells(line);
|
|
74
|
+
if (cells === null)
|
|
75
|
+
return { kind: "other", ok: false, cells: null, violations: [] };
|
|
76
|
+
const lower = cells.map((cell) => cell.toLowerCase());
|
|
77
|
+
if (lower.length === EVIDENCE_ROW_COLUMNS.length
|
|
78
|
+
&& EVIDENCE_ROW_COLUMNS.every((column, index) => lower[index] === column)) {
|
|
79
|
+
return { kind: "header", ok: true, cells: null, violations: [] };
|
|
80
|
+
}
|
|
81
|
+
if (EVIDENCE_ROW_SEPARATOR.test(line.trim())) {
|
|
82
|
+
return { kind: "separator", ok: true, cells: null, violations: [] };
|
|
83
|
+
}
|
|
84
|
+
const violations = [];
|
|
85
|
+
const [claim = "", commandCell = "", outputCell = "", status = ""] = cells;
|
|
86
|
+
if (claim === "" || claim === "—")
|
|
87
|
+
violations.push("invalid-evidence-row-claim");
|
|
88
|
+
// The command must BE a command: prose in that cell is the same defect as an
|
|
89
|
+
// empty one, because a typed expectation is what the shape exists to stop.
|
|
90
|
+
const command = backticked(commandCell);
|
|
91
|
+
if (command === null || command.trim() === "")
|
|
92
|
+
violations.push("invalid-evidence-row-command");
|
|
93
|
+
const output = backticked(outputCell);
|
|
94
|
+
if (output === null || output.trim() === "")
|
|
95
|
+
violations.push("invalid-evidence-row-output");
|
|
96
|
+
if (!EVIDENCE_ROW_VERDICTS.includes(status))
|
|
97
|
+
violations.push("invalid-evidence-row-status");
|
|
98
|
+
return {
|
|
99
|
+
kind: "row",
|
|
100
|
+
ok: violations.length === 0,
|
|
101
|
+
cells: { claim, command: command ?? commandCell, output: output ?? outputCell, status },
|
|
102
|
+
violations,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Validate one line against `evidence-row@1`. A header or separator is not a
|
|
107
|
+
* claim and passes; a non-table line is not a row of this grammar either.
|
|
108
|
+
*
|
|
109
|
+
* @param {string} line
|
|
110
|
+
* @returns {{ ok: boolean, kind: string, cells: object|null, violations: string[] }}
|
|
111
|
+
*/
|
|
112
|
+
export function validateEvidenceRow(line) {
|
|
113
|
+
const parsed = parseEvidenceRow(line);
|
|
114
|
+
if (parsed.kind === "other") {
|
|
115
|
+
return { ...parsed, ok: false, violations: ["invalid-evidence-row-shape"] };
|
|
116
|
+
}
|
|
117
|
+
return parsed;
|
|
118
|
+
}
|
|
30
119
|
// ── Unit doc: progress-log@1 entry regex ─────────────────────────────────
|
|
31
120
|
export const PROGRESS_ENTRY_PATTERN = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2} — .+ → .+ — next: .+$/;
|
|
32
121
|
// ── Roadmap table columns ────────────────────────────────────────────────
|
package/dist/index.d.ts
CHANGED
|
@@ -919,6 +919,7 @@ export { CONTINUATION_CANONICAL_VECTORS, CONTINUATION_VECTOR_CONTRACT } from "./
|
|
|
919
919
|
export { sha256Hex, sha256HexSync } from "./sha256.js";
|
|
920
920
|
export type { ContinuationEvidence, ContinuationPlatformFamily, ContinuationPrecondition, ContinuationRefusalCode, EmitContinuationInput, EmitContinuationResult, EnvelopeContinuation, } from "./continuation.js";
|
|
921
921
|
export type { ContinuationCanonicalVector } from "./continuation-vectors.js";
|
|
922
|
-
export { EVIDENCE_COLUMNS, PROGRESS_ENTRY_PATTERN, ROADMAP_COLUMNS, CHANGELOG_SECTION_PATTERN, BUDGETS_OPERATIONS, MANIFEST_OPERATIONS, UNIT_DOC_OPERATIONS, ROADMAP_OPERATIONS, CHANGELOG_OPERATIONS, } from "./file-schemas.js";
|
|
922
|
+
export { EVIDENCE_COLUMNS, EVIDENCE_ROW_COLUMNS, EVIDENCE_ROW_VERDICTS, parseEvidenceRow, validateEvidenceRow, PROGRESS_ENTRY_PATTERN, ROADMAP_COLUMNS, CHANGELOG_SECTION_PATTERN, BUDGETS_OPERATIONS, MANIFEST_OPERATIONS, UNIT_DOC_OPERATIONS, ROADMAP_OPERATIONS, CHANGELOG_OPERATIONS, } from "./file-schemas.js";
|
|
923
|
+
export { ROADMAP_DOCUMENT, FIX_INDEX_DOCUMENT, ROADMAP_FEATURES_HEADING, ROADMAP_FIXES_HEADING, ROADMAP_LEGACY_READ, } from "./paths.js";
|
|
923
924
|
export { FUTURE_STATUS_KINDS, FINDINGS_TABLE_SEVERITIES, LOG_KIND_TOKENS, SWEEP_CLAIM_KINDS, SWEEP_MISMATCH_REASONS, } from "./vocabularies.js";
|
|
924
925
|
export type { FutureStatus, FindingsTableSeverity, LogKindToken, SweepClaimKind, SweepMismatchReason, } from "./vocabularies.js";
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { canonicalizeContractInput, canonicalJSONValue, utf8Bytes, utf8ByteCompare, } from "./canonical-json.js";
|
|
12
12
|
import { sha256Hex } from "./sha256.js";
|
|
13
|
+
import { FIX_INDEX_DOCUMENT, ROADMAP_DOCUMENT, ROADMAP_FEATURES_HEADING, ROADMAP_FIXES_HEADING, } from "./paths.js";
|
|
13
14
|
import { validateContinuation } from "./continuation.js";
|
|
14
15
|
import { VERIFICATION_COMMAND_STATUSES, VERIFICATION_CONTRACT, VERIFICATION_COST_CLASSES, VERIFICATION_DIAGNOSTIC_CODES, VERIFICATION_LIMITS, VERIFICATION_PLAN_CONTRACT_ID, VERIFICATION_RECEIPT_CONTRACT_ID, VERIFICATION_STAGES, VERIFICATION_VERDICTS, createVerificationDiagnosticSink, captureVerificationInput, validateStructure, } from "./verification-contract.js";
|
|
15
16
|
// ---------------------------------------------------------------------------
|
|
@@ -1567,6 +1568,124 @@ function lineNumber(content, needle) {
|
|
|
1567
1568
|
function documentFor(documents, suffix) {
|
|
1568
1569
|
return documents.find((document) => document.path.endsWith(suffix));
|
|
1569
1570
|
}
|
|
1571
|
+
/**
|
|
1572
|
+
* The consolidated index among the caller's documents (issue #319). Only the
|
|
1573
|
+
* published path matches: the migration window is closed (D4), so a document
|
|
1574
|
+
* list still carrying the pre-move path answers "no index" instead of being
|
|
1575
|
+
* read as one — the snapshot then reports the unit as unknown rather than
|
|
1576
|
+
* deriving a unit from a file that moved.
|
|
1577
|
+
*/
|
|
1578
|
+
function indexDocument(documents) {
|
|
1579
|
+
return documentFor(documents, ROADMAP_DOCUMENT);
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* A fence-looking line: up to three spaces, then three-or-more backticks or
|
|
1583
|
+
* tildes. The schema package's `advanceFence` holds the same shape for the
|
|
1584
|
+
* pre-execution selectors; the index readers below share this one.
|
|
1585
|
+
*/
|
|
1586
|
+
const INDEX_FENCE_LINE = /^ {0,3}(`{3,}|~{3,})(.*)$/;
|
|
1587
|
+
/** The block still open after one line, by CommonMark's rule: it closes only on
|
|
1588
|
+
* a run of the character that opened it, at least as long, followed by spaces. */
|
|
1589
|
+
function indexFenceRun(line, open) {
|
|
1590
|
+
const run = INDEX_FENCE_LINE.exec(line);
|
|
1591
|
+
if (run === null)
|
|
1592
|
+
return open;
|
|
1593
|
+
if (open === null)
|
|
1594
|
+
return /^ {4,}/.test(line) ? null : { marker: run[1][0], length: run[1].length };
|
|
1595
|
+
return run[1][0] === open.marker && run[1].length >= open.length && run[2].trim() === "" ? null : open;
|
|
1596
|
+
}
|
|
1597
|
+
/**
|
|
1598
|
+
* One `## <heading>` section's body, or `undefined` when the document has no
|
|
1599
|
+
* such heading (a pre-319 document carries one table and no heading, so its
|
|
1600
|
+
* whole content is the section).
|
|
1601
|
+
*/
|
|
1602
|
+
function sectionContent(content, heading) {
|
|
1603
|
+
const wanted = heading.trim().toLowerCase();
|
|
1604
|
+
let level = 0;
|
|
1605
|
+
let fence = null;
|
|
1606
|
+
const body = [];
|
|
1607
|
+
for (const line of content.split("\n")) {
|
|
1608
|
+
fence = indexFenceRun(line, fence);
|
|
1609
|
+
const match = fence === null ? /^(#{1,6})\s+(.*)$/.exec(line) : null;
|
|
1610
|
+
if (match) {
|
|
1611
|
+
if (level !== 0 && match[1].length <= level)
|
|
1612
|
+
break;
|
|
1613
|
+
if (level === 0 && match[2].trim().toLowerCase() === wanted) {
|
|
1614
|
+
level = match[1].length;
|
|
1615
|
+
continue;
|
|
1616
|
+
}
|
|
1617
|
+
if (level === 0)
|
|
1618
|
+
continue;
|
|
1619
|
+
}
|
|
1620
|
+
if (level !== 0)
|
|
1621
|
+
body.push(line);
|
|
1622
|
+
}
|
|
1623
|
+
return level === 0 ? undefined : body.join("\n");
|
|
1624
|
+
}
|
|
1625
|
+
/** The live rows of a table body (issue #319, F14): a row inside a fenced or
|
|
1626
|
+
* indented code block is a writer's example, never data — the same grammar the
|
|
1627
|
+
* heading scan uses, so no reader tracks fences differently. Each row keeps the
|
|
1628
|
+
* source line it was read from, so provenance cites that line rather than a
|
|
1629
|
+
* re-rendered row that an escaped `\|` keeps out of the document (issue #319,
|
|
1630
|
+
* F16). */
|
|
1631
|
+
function tableRowCells(content) {
|
|
1632
|
+
const rows = [];
|
|
1633
|
+
let fence = null;
|
|
1634
|
+
for (const line of content.split("\n")) {
|
|
1635
|
+
if (fence === null && !/^ {4,}/.test(line) && line.trimStart().startsWith("|"))
|
|
1636
|
+
rows.push({ cells: tableCells(line), line });
|
|
1637
|
+
fence = indexFenceRun(line, fence);
|
|
1638
|
+
}
|
|
1639
|
+
return rows;
|
|
1640
|
+
}
|
|
1641
|
+
/** The cells of one Markdown table row, splitting only on unescaped pipes — the
|
|
1642
|
+
* same contract the crate's `tableCells` holds (`index-document.mjs`), so a row
|
|
1643
|
+
* carrying an escaped `\|` reads identically on both sides of the mirror. */
|
|
1644
|
+
function tableCells(line) {
|
|
1645
|
+
const cells = [];
|
|
1646
|
+
let current = "";
|
|
1647
|
+
for (let index = 0; index < line.length; index += 1) {
|
|
1648
|
+
const char = line[index];
|
|
1649
|
+
if (char === "\\" && line[index + 1] === "|") {
|
|
1650
|
+
current += "|";
|
|
1651
|
+
index += 1;
|
|
1652
|
+
}
|
|
1653
|
+
else if (char === "|") {
|
|
1654
|
+
cells.push(current.trim());
|
|
1655
|
+
current = "";
|
|
1656
|
+
}
|
|
1657
|
+
else {
|
|
1658
|
+
current += char;
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
cells.push(current.trim());
|
|
1662
|
+
if (cells.length < 2)
|
|
1663
|
+
return [];
|
|
1664
|
+
const body = cells[0] === "" ? cells.slice(1) : cells;
|
|
1665
|
+
return body[body.length - 1] === "" ? body.slice(0, -1) : body;
|
|
1666
|
+
}
|
|
1667
|
+
/** The table body of one kind: its own section when present; a document that
|
|
1668
|
+
* declares its tables by heading has no rows of this kind when this heading is
|
|
1669
|
+
* absent (issue #319, F1); a pre-319 roadmap keeps its single table under its
|
|
1670
|
+
* title, so only the fix read is affected. */
|
|
1671
|
+
function tableFor(content, heading) {
|
|
1672
|
+
const section = sectionContent(content, heading);
|
|
1673
|
+
if (section !== undefined)
|
|
1674
|
+
return section;
|
|
1675
|
+
if (heading !== ROADMAP_FIXES_HEADING)
|
|
1676
|
+
return content;
|
|
1677
|
+
const declaresTables = sectionContent(content, ROADMAP_FEATURES_HEADING) !== undefined
|
|
1678
|
+
|| sectionContent(content, ROADMAP_FIXES_HEADING) !== undefined;
|
|
1679
|
+
return declaresTables ? "" : content;
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Whether a document carries its own `## Fixes` table (issue #319). A migrated
|
|
1683
|
+
* index does; a half-migrated one — `## Features` present, no `## Fixes` yet —
|
|
1684
|
+
* does not, and keeps the documented fallback to the standalone fix index.
|
|
1685
|
+
*/
|
|
1686
|
+
function hasFixTable(content) {
|
|
1687
|
+
return sectionContent(content, ROADMAP_FIXES_HEADING) !== undefined;
|
|
1688
|
+
}
|
|
1570
1689
|
function repositoryStateFrom(document) {
|
|
1571
1690
|
if (document === undefined)
|
|
1572
1691
|
return "missing";
|
|
@@ -1579,15 +1698,15 @@ function roadmapFeature(document) {
|
|
|
1579
1698
|
if (document === undefined)
|
|
1580
1699
|
return null;
|
|
1581
1700
|
const candidates = [];
|
|
1582
|
-
|
|
1583
|
-
|
|
1701
|
+
const table = tableFor(document.content, ROADMAP_FEATURES_HEADING);
|
|
1702
|
+
for (const { cells, line } of tableRowCells(table)) {
|
|
1584
1703
|
if (cells.length < 3 || !/^\d{2}$/.test(cells[0] ?? ""))
|
|
1585
1704
|
continue;
|
|
1586
1705
|
const slug = cells[1]?.replace(/^`|`$/g, "");
|
|
1587
1706
|
if (slug === undefined || slug.length === 0)
|
|
1588
1707
|
continue;
|
|
1589
1708
|
const id = `${cells[0]}-${slug}`;
|
|
1590
|
-
candidates.push({ id, status: cells[2] ?? "unknown", row });
|
|
1709
|
+
candidates.push({ id, status: cells[2] ?? "unknown", row: line });
|
|
1591
1710
|
}
|
|
1592
1711
|
return candidates.find((candidate) => indexStatus(candidate.status) === "in-progress")
|
|
1593
1712
|
?? candidates.find((candidate) => indexStatus(candidate.status) !== "done")
|
|
@@ -1600,14 +1719,15 @@ function fixUnit(document) {
|
|
|
1600
1719
|
if (document === undefined)
|
|
1601
1720
|
return null;
|
|
1602
1721
|
const candidates = [];
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1722
|
+
const table = tableFor(document.content, ROADMAP_FIXES_HEADING);
|
|
1723
|
+
for (const { cells, line } of tableRowCells(table)) {
|
|
1724
|
+
const nonEmpty = cells.filter(Boolean);
|
|
1725
|
+
if (nonEmpty.length < 3)
|
|
1606
1726
|
continue;
|
|
1607
|
-
const id =
|
|
1727
|
+
const id = nonEmpty[0]?.replace(/^`|`$/g, "") ?? "";
|
|
1608
1728
|
if (!/^\d+-[A-Za-z0-9._-]+$/.test(id))
|
|
1609
1729
|
continue;
|
|
1610
|
-
candidates.push({ id, status:
|
|
1730
|
+
candidates.push({ id, status: nonEmpty[2] ?? "unknown", row: line });
|
|
1611
1731
|
}
|
|
1612
1732
|
return candidates.find((candidate) => indexStatus(candidate.status) === "in-progress")
|
|
1613
1733
|
?? candidates.find((candidate) => indexStatus(candidate.status) !== "done")
|
|
@@ -1750,10 +1870,22 @@ export function validateWorkflowSnapshotV1(value) {
|
|
|
1750
1870
|
*/
|
|
1751
1871
|
export function compileWorkflowSnapshot(input) {
|
|
1752
1872
|
const repositoryStateDocument = documentFor(input.documents, "docs/workflow/REPOSITORY_STATE.md");
|
|
1753
|
-
|
|
1873
|
+
// Issue #319 F9: the fallback to the standalone fix index is a property of a
|
|
1874
|
+
// *half-migrated* tree — one whose consolidated index has no `## Fixes` table
|
|
1875
|
+
// yet, which `MIGRATION.md` and `init-workspace`'s upgrade step document as
|
|
1876
|
+
// still readable. A migrated tree is different: its `## Fixes` table exists,
|
|
1877
|
+
// so it owns the fix rows outright and a stale standalone copy must never
|
|
1878
|
+
// shadow them — the crate pins exactly this (`roadmap-check.test.mjs`, "A
|
|
1879
|
+
// stale standalone index that would disagree: it must be ignored"). Reading
|
|
1880
|
+
// the stale row there resolves a unit the consolidated index does not declare
|
|
1881
|
+
// and makes the two published sides disagree on the same tree.
|
|
1882
|
+
const roadmapDocument = indexDocument(input.documents);
|
|
1754
1883
|
const feature = roadmapFeature(roadmapDocument);
|
|
1755
|
-
const
|
|
1756
|
-
const
|
|
1884
|
+
const consolidatedFixes = roadmapDocument === undefined ? null : fixUnit(roadmapDocument);
|
|
1885
|
+
const fixTableOwnsTheRows = roadmapDocument !== undefined && hasFixTable(roadmapDocument.content);
|
|
1886
|
+
const standaloneFixDocument = fixTableOwnsTheRows ? undefined : documentFor(input.documents, FIX_INDEX_DOCUMENT);
|
|
1887
|
+
const fix = feature === null ? (consolidatedFixes ?? fixUnit(standaloneFixDocument)) : null;
|
|
1888
|
+
const fixIndexDocument = consolidatedFixes === null ? (standaloneFixDocument ?? roadmapDocument) : roadmapDocument;
|
|
1757
1889
|
const selected = feature ?? fix;
|
|
1758
1890
|
const selectedKind = feature === null && fix !== null ? "fix" : "feature";
|
|
1759
1891
|
const provenance = [];
|
|
@@ -2916,6 +3048,8 @@ export { CONTINUATION_CANONICAL_VECTORS, CONTINUATION_VECTOR_CONTRACT } from "./
|
|
|
2916
3048
|
export { sha256Hex, sha256HexSync } from "./sha256.js";
|
|
2917
3049
|
// ── File-schema vocabularies (agwo edit) ──────────────────────────────────
|
|
2918
3050
|
// UNIT_DOC_REQUIRED_SECTIONS is already exported from pre-execution.ts (P8).
|
|
2919
|
-
export { EVIDENCE_COLUMNS, PROGRESS_ENTRY_PATTERN, ROADMAP_COLUMNS, CHANGELOG_SECTION_PATTERN, BUDGETS_OPERATIONS, MANIFEST_OPERATIONS, UNIT_DOC_OPERATIONS, ROADMAP_OPERATIONS, CHANGELOG_OPERATIONS, } from "./file-schemas.js";
|
|
3051
|
+
export { EVIDENCE_COLUMNS, EVIDENCE_ROW_COLUMNS, EVIDENCE_ROW_VERDICTS, parseEvidenceRow, validateEvidenceRow, PROGRESS_ENTRY_PATTERN, ROADMAP_COLUMNS, CHANGELOG_SECTION_PATTERN, BUDGETS_OPERATIONS, MANIFEST_OPERATIONS, UNIT_DOC_OPERATIONS, ROADMAP_OPERATIONS, CHANGELOG_OPERATIONS, } from "./file-schemas.js";
|
|
3052
|
+
// ── The location index's published paths (unit 319, issue #319) ─────
|
|
3053
|
+
export { ROADMAP_DOCUMENT, FIX_INDEX_DOCUMENT, ROADMAP_FEATURES_HEADING, ROADMAP_FIXES_HEADING, ROADMAP_LEGACY_READ, } from "./paths.js";
|
|
2920
3054
|
// ── Published closed vocabularies (unit 84, issue #315) ─────────────
|
|
2921
3055
|
export { FUTURE_STATUS_KINDS, FINDINGS_TABLE_SEVERITIES, LOG_KIND_TOKENS, SWEEP_CLAIM_KINDS, SWEEP_MISMATCH_REASONS, } from "./vocabularies.js";
|
package/dist/paths.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The location index's published paths (issue #319).
|
|
3
|
+
*
|
|
4
|
+
* One index, one writer: {@link ROADMAP_DOCUMENT} carries the `## Features`
|
|
5
|
+
* table, the `## Fixes` table and the status machine. The migration window is
|
|
6
|
+
* closed (owner decision D4): this package matches that one path, and the
|
|
7
|
+
* pre-move path — spelled once, in the crate
|
|
8
|
+
* (`packages/agentic-workflow/src/index-document.mjs`) — is never read.
|
|
9
|
+
*
|
|
10
|
+
* `scripts/index-document.test.mjs` holds these values and the crate's equal —
|
|
11
|
+
* the two packages publish one vocabulary, never two copies that can drift.
|
|
12
|
+
*/
|
|
13
|
+
/** The consolidated index: features, fixes and the status machine in one file. */
|
|
14
|
+
export declare const ROADMAP_DOCUMENT = "docs/ROADMAP.md";
|
|
15
|
+
/** The fix index file — the index itself before unit 319, a one-line stub after. */
|
|
16
|
+
export declare const FIX_INDEX_DOCUMENT = "docs/fix/README.md";
|
|
17
|
+
/** The heading of the features table in the consolidated index. */
|
|
18
|
+
export declare const ROADMAP_FEATURES_HEADING = "Features";
|
|
19
|
+
/** The heading of the fixes table in the consolidated index. */
|
|
20
|
+
export declare const ROADMAP_FIXES_HEADING = "Fixes";
|
|
21
|
+
/**
|
|
22
|
+
* The migration window: closed by decision D4. Kept as the documented rollback
|
|
23
|
+
* lever. This package stays dependency-free (no Node typings), so it publishes
|
|
24
|
+
* the closed value; the runtime channel that flips it for an installed package
|
|
25
|
+
* lives in the crate (`src/index-document.mjs`), which is the module that reads
|
|
26
|
+
* the filesystem. Both sides state the same fact: the window is closed.
|
|
27
|
+
*/
|
|
28
|
+
export declare const ROADMAP_LEGACY_READ = false;
|
package/dist/paths.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The location index's published paths (issue #319).
|
|
3
|
+
*
|
|
4
|
+
* One index, one writer: {@link ROADMAP_DOCUMENT} carries the `## Features`
|
|
5
|
+
* table, the `## Fixes` table and the status machine. The migration window is
|
|
6
|
+
* closed (owner decision D4): this package matches that one path, and the
|
|
7
|
+
* pre-move path — spelled once, in the crate
|
|
8
|
+
* (`packages/agentic-workflow/src/index-document.mjs`) — is never read.
|
|
9
|
+
*
|
|
10
|
+
* `scripts/index-document.test.mjs` holds these values and the crate's equal —
|
|
11
|
+
* the two packages publish one vocabulary, never two copies that can drift.
|
|
12
|
+
*/
|
|
13
|
+
/** The consolidated index: features, fixes and the status machine in one file. */
|
|
14
|
+
export const ROADMAP_DOCUMENT = "docs/ROADMAP.md";
|
|
15
|
+
/** The fix index file — the index itself before unit 319, a one-line stub after. */
|
|
16
|
+
export const FIX_INDEX_DOCUMENT = "docs/fix/README.md";
|
|
17
|
+
/** The heading of the features table in the consolidated index. */
|
|
18
|
+
export const ROADMAP_FEATURES_HEADING = "Features";
|
|
19
|
+
/** The heading of the fixes table in the consolidated index. */
|
|
20
|
+
export const ROADMAP_FIXES_HEADING = "Fixes";
|
|
21
|
+
/**
|
|
22
|
+
* The migration window: closed by decision D4. Kept as the documented rollback
|
|
23
|
+
* lever. This package stays dependency-free (no Node typings), so it publishes
|
|
24
|
+
* the closed value; the runtime channel that flips it for an installed package
|
|
25
|
+
* lives in the crate (`src/index-document.mjs`), which is the module that reads
|
|
26
|
+
* the filesystem. Both sides state the same fact: the window is closed.
|
|
27
|
+
*/
|
|
28
|
+
export const ROADMAP_LEGACY_READ = false;
|
|
@@ -30,6 +30,10 @@ export const PRE_EXECUTION_CANONICAL_VECTORS = Object.freeze([
|
|
|
30
30
|
Object.freeze({
|
|
31
31
|
contract: "agentic-workflow/pre-execution-review-receipt@1",
|
|
32
32
|
description: "Plan-stage arbiter receipt carrying two findings and one critic parent digest",
|
|
33
|
-
|
|
33
|
+
// Unit 319: the fixture's finding F-1 cited the location index at its
|
|
34
|
+
// pre-move path. The index moved to `docs/ROADMAP.md`, so the payload's
|
|
35
|
+
// evidence ref changed and this digest was re-blessed with it in the same
|
|
36
|
+
// change — a declared contract-data change, recorded in CHANGELOG.md.
|
|
37
|
+
digest: "a74771f91d2f04c05a1a699e72cb44ca0052452efb41d05954e3ce0e57f90233",
|
|
34
38
|
}),
|
|
35
39
|
]);
|
package/dist/pre-execution.d.ts
CHANGED
|
@@ -224,6 +224,11 @@ export type SpecProductSelection = {
|
|
|
224
224
|
readonly ok: false;
|
|
225
225
|
readonly errors: readonly SpecProductSelectorError[];
|
|
226
226
|
};
|
|
227
|
+
/** The fence a selector pass is inside: which character opened it, and how long it was. */
|
|
228
|
+
export type FenceRun = {
|
|
229
|
+
readonly marker: string;
|
|
230
|
+
readonly length: number;
|
|
231
|
+
};
|
|
227
232
|
/**
|
|
228
233
|
* Resolve which accepted shape a set of level-2 headings belongs to: the shape
|
|
229
234
|
* whose required sections are all present, preferring `legacy` when both are (a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtrabanco/agentic-workflow-schema",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-canary.20261102.1",
|
|
4
4
|
"description": "Versioned machine contracts, JSON Schemas, parsers, and deterministic document snapshots for agentic-workflow orchestration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentic-workflow",
|
|
@@ -75,6 +75,6 @@
|
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"ajv": "8.20.0",
|
|
78
|
-
"typescript": "
|
|
78
|
+
"typescript": "7"
|
|
79
79
|
}
|
|
80
80
|
}
|