@gtrabanco/agentic-workflow-schema 4.10.0 → 5.0.0-canary.20261104.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 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/features/ROADMAP.md", content: roadmap },
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
  ],
@@ -236,7 +236,7 @@ function decideWorkflowAction(input: WorkflowDecisionInput): WorkflowActionDecis
236
236
  revision), snapshot state unknown or contradicted, unrecognized next intent,
237
237
  and any transition not in the closed table.
238
238
 
239
- See [SPEC](../features/24-workflow-transition-decider/SPEC.md) for the full
239
+ See [SPEC](../../docs/features/24-workflow-transition-decider/SPEC.md) for the full
240
240
  design, transition tables, and reason-code vocabulary.
241
241
 
242
242
  Package major versions signal a breaking change to any published contract.
package/dist/index.d.ts CHANGED
@@ -920,5 +920,6 @@ 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
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 { FUTURE_STATUS_KINDS, FINDINGS_TABLE_SEVERITIES, LOG_KIND_TOKENS, SWEEP_CLAIM_KINDS, SWEEP_MISMATCH_REASONS, } from "./vocabularies.js";
924
- export type { FutureStatus, FindingsTableSeverity, LogKindToken, SweepClaimKind, SweepMismatchReason, } from "./vocabularies.js";
923
+ export { ROADMAP_DOCUMENT, FIX_INDEX_DOCUMENT, ROADMAP_FEATURES_HEADING, ROADMAP_FIXES_HEADING, ROADMAP_LEGACY_READ, } from "./paths.js";
924
+ export { FUTURE_STATUS_KINDS, FINDINGS_TABLE_SEVERITIES, FINDINGS_TABLE_IMPACTS, LOG_KIND_TOKENS, SWEEP_CLAIM_KINDS, SWEEP_MISMATCH_REASONS, RISK_TIER_KINDS, RISK_TIER_SIGNAL_KINDS, RISK_TIER_REASONS, SIZE_TIER_KINDS, } from "./vocabularies.js";
925
+ export type { FutureStatus, FindingsTableSeverity, FindingsTableImpact, LogKindToken, SweepClaimKind, SweepMismatchReason, RiskTier, RiskTierSignal, RiskTierReason, SizeTier, } 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
  // ---------------------------------------------------------------------------
@@ -373,6 +374,17 @@ function rejectUnexpectedKeys(value, path, keys, errors) {
373
374
  errors.push(`unexpected key: ${path}.${key}`);
374
375
  }
375
376
  }
377
+ /**
378
+ * The `detail` object's declared keys (issue #360 adds `risk_tier`). `detail` is
379
+ * the sensor's projection surface: every field is delivered as an object above,
380
+ * so the envelope's licence to extend it is not a licence to invent a key.
381
+ */
382
+ const DETAIL_KEYS = [
383
+ "repository_state", "design_candidates", "pre_execution", "review_loop_cycles",
384
+ "features", "fixes", "startable_now", "blocked_units", "open_prs", "pending_triage",
385
+ "untriaged_issues", "workflow_observations", "degradations", "continuation_refusal",
386
+ "crash_recovery", "urgent", "substrate_notice", "risk_tier", "size_tier",
387
+ ];
376
388
  function rejectUnexpectedEnvelopeKeys(value, errors) {
377
389
  rejectUnexpectedKeys(value.unit, "unit", ["type", "id", "issue", "branch"], errors);
378
390
  rejectUnexpectedKeys(value.phase, "phase", ["current", "total", "completed"], errors);
@@ -391,6 +403,18 @@ function rejectUnexpectedEnvelopeKeys(value, errors) {
391
403
  }
392
404
  rejectUnexpectedKeys(value.dependencies, "dependencies", ["unmet", "build_order"], errors);
393
405
  rejectUnexpectedKeys(value.recommendations, "recommendations", ["product_audit", "reason"], errors);
406
+ // Issue #360: the risk tier the classifier computed for the unit in scope. A
407
+ // distinct key from `next.tier` (the model budget), never a second spelling of it.
408
+ rejectUnexpectedKeys(value.detail, "detail", DETAIL_KEYS, errors);
409
+ if (isObj(value.detail) && isObj(value.detail.size_tier)) {
410
+ rejectUnexpectedKeys(value.detail.size_tier, "detail.size_tier", ["size_tier", "changed_paths"], errors);
411
+ }
412
+ if (isObj(value.detail) && isObj(value.detail.risk_tier)) {
413
+ rejectUnexpectedKeys(value.detail.risk_tier, "detail.risk_tier", ["tier", "reason", "reason_kind", "signals", "task_size"], errors);
414
+ if (isObj(value.detail.risk_tier.task_size)) {
415
+ rejectUnexpectedKeys(value.detail.risk_tier.task_size, "detail.risk_tier.task_size", ["understood", "contained_risk", "resumable_from_diff", "ceremony", "verification"], errors);
416
+ }
417
+ }
394
418
  if (value.needs_input !== null) {
395
419
  rejectUnexpectedKeys(value.needs_input, "needs_input", ["question", "options"], errors);
396
420
  }
@@ -1567,6 +1591,124 @@ function lineNumber(content, needle) {
1567
1591
  function documentFor(documents, suffix) {
1568
1592
  return documents.find((document) => document.path.endsWith(suffix));
1569
1593
  }
1594
+ /**
1595
+ * The consolidated index among the caller's documents (issue #319). Only the
1596
+ * published path matches: the migration window is closed (D4), so a document
1597
+ * list still carrying the pre-move path answers "no index" instead of being
1598
+ * read as one — the snapshot then reports the unit as unknown rather than
1599
+ * deriving a unit from a file that moved.
1600
+ */
1601
+ function indexDocument(documents) {
1602
+ return documentFor(documents, ROADMAP_DOCUMENT);
1603
+ }
1604
+ /**
1605
+ * A fence-looking line: up to three spaces, then three-or-more backticks or
1606
+ * tildes. The schema package's `advanceFence` holds the same shape for the
1607
+ * pre-execution selectors; the index readers below share this one.
1608
+ */
1609
+ const INDEX_FENCE_LINE = /^ {0,3}(`{3,}|~{3,})(.*)$/;
1610
+ /** The block still open after one line, by CommonMark's rule: it closes only on
1611
+ * a run of the character that opened it, at least as long, followed by spaces. */
1612
+ function indexFenceRun(line, open) {
1613
+ const run = INDEX_FENCE_LINE.exec(line);
1614
+ if (run === null)
1615
+ return open;
1616
+ if (open === null)
1617
+ return /^ {4,}/.test(line) ? null : { marker: run[1][0], length: run[1].length };
1618
+ return run[1][0] === open.marker && run[1].length >= open.length && run[2].trim() === "" ? null : open;
1619
+ }
1620
+ /**
1621
+ * One `## <heading>` section's body, or `undefined` when the document has no
1622
+ * such heading (a pre-319 document carries one table and no heading, so its
1623
+ * whole content is the section).
1624
+ */
1625
+ function sectionContent(content, heading) {
1626
+ const wanted = heading.trim().toLowerCase();
1627
+ let level = 0;
1628
+ let fence = null;
1629
+ const body = [];
1630
+ for (const line of content.split("\n")) {
1631
+ fence = indexFenceRun(line, fence);
1632
+ const match = fence === null ? /^(#{1,6})\s+(.*)$/.exec(line) : null;
1633
+ if (match) {
1634
+ if (level !== 0 && match[1].length <= level)
1635
+ break;
1636
+ if (level === 0 && match[2].trim().toLowerCase() === wanted) {
1637
+ level = match[1].length;
1638
+ continue;
1639
+ }
1640
+ if (level === 0)
1641
+ continue;
1642
+ }
1643
+ if (level !== 0)
1644
+ body.push(line);
1645
+ }
1646
+ return level === 0 ? undefined : body.join("\n");
1647
+ }
1648
+ /** The live rows of a table body (issue #319, F14): a row inside a fenced or
1649
+ * indented code block is a writer's example, never data — the same grammar the
1650
+ * heading scan uses, so no reader tracks fences differently. Each row keeps the
1651
+ * source line it was read from, so provenance cites that line rather than a
1652
+ * re-rendered row that an escaped `\|` keeps out of the document (issue #319,
1653
+ * F16). */
1654
+ function tableRowCells(content) {
1655
+ const rows = [];
1656
+ let fence = null;
1657
+ for (const line of content.split("\n")) {
1658
+ if (fence === null && !/^ {4,}/.test(line) && line.trimStart().startsWith("|"))
1659
+ rows.push({ cells: tableCells(line), line });
1660
+ fence = indexFenceRun(line, fence);
1661
+ }
1662
+ return rows;
1663
+ }
1664
+ /** The cells of one Markdown table row, splitting only on unescaped pipes — the
1665
+ * same contract the crate's `tableCells` holds (`index-document.mjs`), so a row
1666
+ * carrying an escaped `\|` reads identically on both sides of the mirror. */
1667
+ function tableCells(line) {
1668
+ const cells = [];
1669
+ let current = "";
1670
+ for (let index = 0; index < line.length; index += 1) {
1671
+ const char = line[index];
1672
+ if (char === "\\" && line[index + 1] === "|") {
1673
+ current += "|";
1674
+ index += 1;
1675
+ }
1676
+ else if (char === "|") {
1677
+ cells.push(current.trim());
1678
+ current = "";
1679
+ }
1680
+ else {
1681
+ current += char;
1682
+ }
1683
+ }
1684
+ cells.push(current.trim());
1685
+ if (cells.length < 2)
1686
+ return [];
1687
+ const body = cells[0] === "" ? cells.slice(1) : cells;
1688
+ return body[body.length - 1] === "" ? body.slice(0, -1) : body;
1689
+ }
1690
+ /** The table body of one kind: its own section when present; a document that
1691
+ * declares its tables by heading has no rows of this kind when this heading is
1692
+ * absent (issue #319, F1); a pre-319 roadmap keeps its single table under its
1693
+ * title, so only the fix read is affected. */
1694
+ function tableFor(content, heading) {
1695
+ const section = sectionContent(content, heading);
1696
+ if (section !== undefined)
1697
+ return section;
1698
+ if (heading !== ROADMAP_FIXES_HEADING)
1699
+ return content;
1700
+ const declaresTables = sectionContent(content, ROADMAP_FEATURES_HEADING) !== undefined
1701
+ || sectionContent(content, ROADMAP_FIXES_HEADING) !== undefined;
1702
+ return declaresTables ? "" : content;
1703
+ }
1704
+ /**
1705
+ * Whether a document carries its own `## Fixes` table (issue #319). A migrated
1706
+ * index does; a half-migrated one — `## Features` present, no `## Fixes` yet —
1707
+ * does not, and keeps the documented fallback to the standalone fix index.
1708
+ */
1709
+ function hasFixTable(content) {
1710
+ return sectionContent(content, ROADMAP_FIXES_HEADING) !== undefined;
1711
+ }
1570
1712
  function repositoryStateFrom(document) {
1571
1713
  if (document === undefined)
1572
1714
  return "missing";
@@ -1579,15 +1721,15 @@ function roadmapFeature(document) {
1579
1721
  if (document === undefined)
1580
1722
  return null;
1581
1723
  const candidates = [];
1582
- for (const row of document.content.split("\n")) {
1583
- const cells = row.split("|").map((cell) => cell.trim()).filter(Boolean);
1724
+ const table = tableFor(document.content, ROADMAP_FEATURES_HEADING);
1725
+ for (const { cells, line } of tableRowCells(table)) {
1584
1726
  if (cells.length < 3 || !/^\d{2}$/.test(cells[0] ?? ""))
1585
1727
  continue;
1586
1728
  const slug = cells[1]?.replace(/^`|`$/g, "");
1587
1729
  if (slug === undefined || slug.length === 0)
1588
1730
  continue;
1589
1731
  const id = `${cells[0]}-${slug}`;
1590
- candidates.push({ id, status: cells[2] ?? "unknown", row });
1732
+ candidates.push({ id, status: cells[2] ?? "unknown", row: line });
1591
1733
  }
1592
1734
  return candidates.find((candidate) => indexStatus(candidate.status) === "in-progress")
1593
1735
  ?? candidates.find((candidate) => indexStatus(candidate.status) !== "done")
@@ -1600,14 +1742,15 @@ function fixUnit(document) {
1600
1742
  if (document === undefined)
1601
1743
  return null;
1602
1744
  const candidates = [];
1603
- for (const row of document.content.split("\n")) {
1604
- const cells = row.split("|").map((cell) => cell.trim()).filter(Boolean);
1605
- if (cells.length < 3)
1745
+ const table = tableFor(document.content, ROADMAP_FIXES_HEADING);
1746
+ for (const { cells, line } of tableRowCells(table)) {
1747
+ const nonEmpty = cells.filter(Boolean);
1748
+ if (nonEmpty.length < 3)
1606
1749
  continue;
1607
- const id = cells[0]?.replace(/^`|`$/g, "") ?? "";
1750
+ const id = nonEmpty[0]?.replace(/^`|`$/g, "") ?? "";
1608
1751
  if (!/^\d+-[A-Za-z0-9._-]+$/.test(id))
1609
1752
  continue;
1610
- candidates.push({ id, status: cells[2] ?? "unknown", row });
1753
+ candidates.push({ id, status: nonEmpty[2] ?? "unknown", row: line });
1611
1754
  }
1612
1755
  return candidates.find((candidate) => indexStatus(candidate.status) === "in-progress")
1613
1756
  ?? candidates.find((candidate) => indexStatus(candidate.status) !== "done")
@@ -1750,10 +1893,22 @@ export function validateWorkflowSnapshotV1(value) {
1750
1893
  */
1751
1894
  export function compileWorkflowSnapshot(input) {
1752
1895
  const repositoryStateDocument = documentFor(input.documents, "docs/workflow/REPOSITORY_STATE.md");
1753
- const roadmapDocument = documentFor(input.documents, "docs/features/ROADMAP.md");
1896
+ // Issue #319 F9: the fallback to the standalone fix index is a property of a
1897
+ // *half-migrated* tree — one whose consolidated index has no `## Fixes` table
1898
+ // yet, which `MIGRATION.md` and `init-workspace`'s upgrade step document as
1899
+ // still readable. A migrated tree is different: its `## Fixes` table exists,
1900
+ // so it owns the fix rows outright and a stale standalone copy must never
1901
+ // shadow them — the crate pins exactly this (`roadmap-check.test.mjs`, "A
1902
+ // stale standalone index that would disagree: it must be ignored"). Reading
1903
+ // the stale row there resolves a unit the consolidated index does not declare
1904
+ // and makes the two published sides disagree on the same tree.
1905
+ const roadmapDocument = indexDocument(input.documents);
1754
1906
  const feature = roadmapFeature(roadmapDocument);
1755
- const fixIndexDocument = documentFor(input.documents, "docs/fix/README.md");
1756
- const fix = feature === null ? fixUnit(fixIndexDocument) : null;
1907
+ const consolidatedFixes = roadmapDocument === undefined ? null : fixUnit(roadmapDocument);
1908
+ const fixTableOwnsTheRows = roadmapDocument !== undefined && hasFixTable(roadmapDocument.content);
1909
+ const standaloneFixDocument = fixTableOwnsTheRows ? undefined : documentFor(input.documents, FIX_INDEX_DOCUMENT);
1910
+ const fix = feature === null ? (consolidatedFixes ?? fixUnit(standaloneFixDocument)) : null;
1911
+ const fixIndexDocument = consolidatedFixes === null ? (standaloneFixDocument ?? roadmapDocument) : roadmapDocument;
1757
1912
  const selected = feature ?? fix;
1758
1913
  const selectedKind = feature === null && fix !== null ? "fix" : "feature";
1759
1914
  const provenance = [];
@@ -2917,5 +3072,7 @@ export { sha256Hex, sha256HexSync } from "./sha256.js";
2917
3072
  // ── File-schema vocabularies (agwo edit) ──────────────────────────────────
2918
3073
  // UNIT_DOC_REQUIRED_SECTIONS is already exported from pre-execution.ts (P8).
2919
3074
  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";
3075
+ // ── The location index's published paths (unit 319, issue #319) ─────
3076
+ export { ROADMAP_DOCUMENT, FIX_INDEX_DOCUMENT, ROADMAP_FEATURES_HEADING, ROADMAP_FIXES_HEADING, ROADMAP_LEGACY_READ, } from "./paths.js";
2920
3077
  // ── Published closed vocabularies (unit 84, issue #315) ─────────────
2921
- export { FUTURE_STATUS_KINDS, FINDINGS_TABLE_SEVERITIES, LOG_KIND_TOKENS, SWEEP_CLAIM_KINDS, SWEEP_MISMATCH_REASONS, } from "./vocabularies.js";
3078
+ export { FUTURE_STATUS_KINDS, FINDINGS_TABLE_SEVERITIES, FINDINGS_TABLE_IMPACTS, LOG_KIND_TOKENS, SWEEP_CLAIM_KINDS, SWEEP_MISMATCH_REASONS, RISK_TIER_KINDS, RISK_TIER_SIGNAL_KINDS, RISK_TIER_REASONS, SIZE_TIER_KINDS, } from "./vocabularies.js";
@@ -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
- digest: "27d7d2b949b2776dc386ba217d93926f02580d54b7c194a99710f6f3696ee97e",
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
  ]);
@@ -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
@@ -14,13 +14,24 @@
14
14
  * `discarded <YYYY-MM-DD>` (the date is grammar, not vocabulary). */
15
15
  export declare const FUTURE_STATUS_KINDS: readonly string[];
16
16
  export type FutureStatus = (typeof FUTURE_STATUS_KINDS)[number];
17
- /** The findings-table severity vocabulary (`finding-severity`), published by
18
- * the `findings-table@1` block: `high | med | low`. Distinct from the review
19
- * payload's five-level `FINDING_SEVERITIES` scale (index.ts) — the table is
20
- * the ledger scale; the sensor's `SEVERITY_VOCABULARY` may accept legacy
21
- * aliases on read, but the canonical table scale is this set. */
17
+ /** The findings-table severity ladder (`finding-severity-ladder`, issue #361),
18
+ * published by the `findings-table@1` block: `BLOCKER | CRITICAL | WARNING |
19
+ * SUGGESTION`. It replaces the retired `high | med | low` ledger scale; it is
20
+ * distinct from the review payload's five-level `FINDING_SEVERITIES` scale and
21
+ * from the planning receipt's `PRE_EXECUTION_FINDING_SEVERITIES` (both map onto
22
+ * the ladder through `review-implementation`'s conversion table), and it is the
23
+ * only severity a finder may assign. `BLOCKER` is never a conversion target: it
24
+ * requires a reproducer (a failure caused by the change), never a scale. */
22
25
  export declare const FINDINGS_TABLE_SEVERITIES: readonly string[];
23
26
  export type FindingsTableSeverity = (typeof FINDINGS_TABLE_SEVERITIES)[number];
27
+ /** The findings-table impact vocabulary (`finding-impact`, issue #361), published
28
+ * beside the severity by the same `findings-table@1` block: `blocking |
29
+ * docs-only | report-only` — does the finding affect behaviour, only documents,
30
+ * or nothing that blocks. A `BLOCKER` row is `blocking` or `docs-only`;
31
+ * `report-only` is the pre-existing advisory's impact (never a correction
32
+ * round). */
33
+ export declare const FINDINGS_TABLE_IMPACTS: readonly string[];
34
+ export type FindingsTableImpact = (typeof FINDINGS_TABLE_IMPACTS)[number];
24
35
  /** The `## Log` line-kind vocabulary (`log-kind`), published by the
25
36
  * `log-kind@1` block. The reader const is `scripts/unit-doc-phases.mjs`
26
37
  * `LOG_KINDS`; the parity suite pins the two together. */
@@ -35,3 +46,27 @@ export type SweepClaimKind = (typeof SWEEP_CLAIM_KINDS)[number];
35
46
  /** The sweep claim's fail-closed reason code. */
36
47
  export declare const SWEEP_MISMATCH_REASONS: readonly string[];
37
48
  export type SweepMismatchReason = (typeof SWEEP_MISMATCH_REASONS)[number];
49
+ /** The risk tiers (`risk-tier`), published by the `risk-tier-verdict@1` block
50
+ * (owner: `skills/execute-phase/references/risk-tiers.md`) and emitted only by
51
+ * the ceremony CLI's `tier classify` — never by the model (issue #360 S5, S7).
52
+ * A distinct vocabulary from the model-budget tier `next.tier`
53
+ * (`strong | cheap`): this one names the ceremony a change owes. */
54
+ export declare const RISK_TIER_KINDS: readonly string[];
55
+ export type RiskTier = (typeof RISK_TIER_KINDS)[number];
56
+ /** The named high-risk items a `high` verdict must carry (issue #360 S5): the
57
+ * tier is never bare, and every token here resolves a path class the
58
+ * classifier owns. `content` marks an executable change that raised no named
59
+ * surface; it is how `standard` explains itself too. */
60
+ export declare const RISK_TIER_SIGNAL_KINDS: readonly string[];
61
+ export type RiskTierSignal = (typeof RISK_TIER_SIGNAL_KINDS)[number];
62
+ /** The size tier (`size-tier`), published by the `risk-tier-verdict@1` block:
63
+ * what the unit's *size* is, for the two decisions that need one — splitting a
64
+ * unit that is too large and grouping several small ones (issue #360 S2, S5).
65
+ * Deliberately a different field from the risk tier: a one-file auth change is
66
+ * `small` and `high`; a 400-file docs sweep is `prose` and `passive`. */
67
+ export declare const SIZE_TIER_KINDS: readonly string[];
68
+ export type SizeTier = (typeof SIZE_TIER_KINDS)[number];
69
+ /** Why the classifier answered what it answered — a closed set, so a reason is
70
+ * grammar rather than prose a reader has to trust. */
71
+ export declare const RISK_TIER_REASONS: readonly string[];
72
+ export type RiskTierReason = (typeof RISK_TIER_REASONS)[number];
@@ -13,12 +13,22 @@
13
13
  * unit-doc templates and the `UnitDoc` skeleton: `open`, `planned`, or
14
14
  * `discarded <YYYY-MM-DD>` (the date is grammar, not vocabulary). */
15
15
  export const FUTURE_STATUS_KINDS = Object.freeze(["open", "planned", "discarded"]);
16
- /** The findings-table severity vocabulary (`finding-severity`), published by
17
- * the `findings-table@1` block: `high | med | low`. Distinct from the review
18
- * payload's five-level `FINDING_SEVERITIES` scale (index.ts) — the table is
19
- * the ledger scale; the sensor's `SEVERITY_VOCABULARY` may accept legacy
20
- * aliases on read, but the canonical table scale is this set. */
21
- export const FINDINGS_TABLE_SEVERITIES = Object.freeze(["high", "med", "low"]);
16
+ /** The findings-table severity ladder (`finding-severity-ladder`, issue #361),
17
+ * published by the `findings-table@1` block: `BLOCKER | CRITICAL | WARNING |
18
+ * SUGGESTION`. It replaces the retired `high | med | low` ledger scale; it is
19
+ * distinct from the review payload's five-level `FINDING_SEVERITIES` scale and
20
+ * from the planning receipt's `PRE_EXECUTION_FINDING_SEVERITIES` (both map onto
21
+ * the ladder through `review-implementation`'s conversion table), and it is the
22
+ * only severity a finder may assign. `BLOCKER` is never a conversion target: it
23
+ * requires a reproducer (a failure caused by the change), never a scale. */
24
+ export const FINDINGS_TABLE_SEVERITIES = Object.freeze(["BLOCKER", "CRITICAL", "WARNING", "SUGGESTION"]);
25
+ /** The findings-table impact vocabulary (`finding-impact`, issue #361), published
26
+ * beside the severity by the same `findings-table@1` block: `blocking |
27
+ * docs-only | report-only` — does the finding affect behaviour, only documents,
28
+ * or nothing that blocks. A `BLOCKER` row is `blocking` or `docs-only`;
29
+ * `report-only` is the pre-existing advisory's impact (never a correction
30
+ * round). */
31
+ export const FINDINGS_TABLE_IMPACTS = Object.freeze(["blocking", "docs-only", "report-only"]);
22
32
  // The findings-table class vocabulary (`finding-class`) is already published
23
33
  // canonically: `PRE_EXECUTION_FINDING_CLASSES` in `pre-execution.ts` is exactly
24
34
  // the `product | plan | source | environment | runtime` set the
@@ -34,3 +44,29 @@ export const LOG_KIND_TOKENS = Object.freeze(["L", "E", "G", "F", "D", "P", "R",
34
44
  export const SWEEP_CLAIM_KINDS = Object.freeze(["sweep"]);
35
45
  /** The sweep claim's fail-closed reason code. */
36
46
  export const SWEEP_MISMATCH_REASONS = Object.freeze(["sweep-mismatch"]);
47
+ /** The risk tiers (`risk-tier`), published by the `risk-tier-verdict@1` block
48
+ * (owner: `skills/execute-phase/references/risk-tiers.md`) and emitted only by
49
+ * the ceremony CLI's `tier classify` — never by the model (issue #360 S5, S7).
50
+ * A distinct vocabulary from the model-budget tier `next.tier`
51
+ * (`strong | cheap`): this one names the ceremony a change owes. */
52
+ export const RISK_TIER_KINDS = Object.freeze(["passive", "standard", "high"]);
53
+ /** The named high-risk items a `high` verdict must carry (issue #360 S5): the
54
+ * tier is never bare, and every token here resolves a path class the
55
+ * classifier owns. `content` marks an executable change that raised no named
56
+ * surface; it is how `standard` explains itself too. */
57
+ export const RISK_TIER_SIGNAL_KINDS = Object.freeze(["auth", "security", "destructive", "ci", "publish", "content"]);
58
+ /** The size tier (`size-tier`), published by the `risk-tier-verdict@1` block:
59
+ * what the unit's *size* is, for the two decisions that need one — splitting a
60
+ * unit that is too large and grouping several small ones (issue #360 S2, S5).
61
+ * Deliberately a different field from the risk tier: a one-file auth change is
62
+ * `small` and `high`; a 400-file docs sweep is `prose` and `passive`. */
63
+ export const SIZE_TIER_KINDS = Object.freeze(["prose", "small", "large"]);
64
+ /** Why the classifier answered what it answered — a closed set, so a reason is
65
+ * grammar rather than prose a reader has to trust. */
66
+ export const RISK_TIER_REASONS = Object.freeze([
67
+ "no-executable-effect",
68
+ "comment-only",
69
+ "executable-content",
70
+ "named-high-risk",
71
+ "empty-change",
72
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtrabanco/agentic-workflow-schema",
3
- "version": "4.10.0",
3
+ "version": "5.0.0-canary.20261104.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",