@codedrifters/configulator 0.0.234 → 0.0.236

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/lib/index.mjs CHANGED
@@ -7264,6 +7264,106 @@ var projenBundle = {
7264
7264
  ]
7265
7265
  };
7266
7266
 
7267
+ // src/agent/bundles/requirements-taxonomy.ts
7268
+ var REQUIREMENTS_TAXONOMY_TABLE_SECTION = [
7269
+ "## The 11-Category Taxonomy",
7270
+ "",
7271
+ "All requirements follow the BIZBOK-aligned 11-category taxonomy",
7272
+ "below. Getting requirements into the right category matters because",
7273
+ "it determines which template applies, which standards inform it, and",
7274
+ "how it traces to other requirements.",
7275
+ "",
7276
+ "| Category | Prefix | Directory (default) | Question it answers |",
7277
+ "|----------|--------|---------------------|---------------------|",
7278
+ "| Business Requirements | BR | `business/` | **Why** are we building this? What business value does it deliver? |",
7279
+ "| Functional Requirements | FR | `functional/` | **What** does the system do? What is the user-visible behavior? |",
7280
+ "| Non-Functional Requirements | NFR | `non-functional/` | **How well** must the system perform? What quality bar must it meet? |",
7281
+ "| Technical Requirements | TR | `technical/` | **What technology** are we using, and why that one? |",
7282
+ "| Architectural Decisions | ADR | `architectural-decisions/` | **What structural decision** are we making, and what are the trade-offs? |",
7283
+ "| Security & Compliance | SEC | `security/` | **What must we protect**, and what rules govern that protection? |",
7284
+ "| Data Requirements | DR | `data/` | **What data** do we store, how long, and how do we recover it? |",
7285
+ "| Integration Requirements | INT | `integration/` | **What external systems** do we connect to, and how? |",
7286
+ "| Operational Requirements | OPS | `operational/` | **How do we deploy, monitor, and respond** to incidents? |",
7287
+ "| UX Requirements | UX | `ux/` | **How must the interface look, feel, and behave** for users? |",
7288
+ "| Multi-Tenancy & Licensing | MT | `multi-tenancy/` | **How do we isolate tenants, gate features, and meter usage?** |",
7289
+ "",
7290
+ "All requirement documents live under `<REQUIREMENTS_ROOT>` in the",
7291
+ "category directory shown above. Directory names are defaults \u2014",
7292
+ "consuming projects may rename them, but the prefixes are universal."
7293
+ ];
7294
+ var REQUIREMENTS_TAXONOMY_DISAMBIGUATION_SECTION = [
7295
+ "- **SEC vs NFR:** Protecting data, enforcing access control, or",
7296
+ " meeting a regulation \u2192 SEC. System performance, uptime, or",
7297
+ ' scalability \u2192 NFR. "99.9% uptime" is NFR; "audit logs for all',
7298
+ ' admin actions" is SEC.',
7299
+ '- **TR vs ADR:** A TR pins down a specific technology choice ("use',
7300
+ ' PostgreSQL 16+"). An ADR records a structural decision with',
7301
+ ' context, trade-offs, and alternatives ("why row-level isolation',
7302
+ ' over schema-per-tenant"). TRs often follow from ADRs.',
7303
+ "- **FR vs INT:** What the user experiences \u2192 FR. How two systems",
7304
+ ' communicate \u2192 INT. "User can pay with a credit card" is FR;',
7305
+ ' "Stripe Checkout API integration for payment processing" is INT.',
7306
+ "- **DR vs SEC:** What data exists, how long we keep it, and how we",
7307
+ " recover it \u2192 DR. Who can access it and how it's protected \u2192 SEC.",
7308
+ " These often cross-reference each other.",
7309
+ "- **NFR vs OPS:** A measurable target the system must meet \u2192 NFR.",
7310
+ ' The tooling and processes to run the system \u2192 OPS. "p99 latency',
7311
+ ' < 200ms" is NFR; "Datadog APM for latency monitoring" is OPS.'
7312
+ ];
7313
+ var REQUIREMENTS_TIER_TABLE_SECTION = [
7314
+ "| Tier | Slug | When to use |",
7315
+ "|------|------|-------------|",
7316
+ "| **Platform** | `platform` | Core platform services \u2014 APIs, tenant isolation, auth, event bus, shared infrastructure |",
7317
+ "| **Industry** | `industry` | Vertical-specific capabilities not every tenant needs |",
7318
+ "| **Customer Workflow** | `customer-workflow` | Business logic tenants configure within the platform \u2014 approval chains, notification rules, intake processes |",
7319
+ "| **Consumer Application** | `consumer-app` | UI/UX and integrations in external front-ends/systems consuming the platform's APIs |"
7320
+ ];
7321
+ var REQ_WRITE_ISSUE_SCHEMA_SECTION = [
7322
+ "The body of every `req:write` issue **must** declare the three",
7323
+ "fields below. The downstream `requirements-writer` agent parses",
7324
+ "them on intake and will refuse to write a document (and flag the",
7325
+ "issue `status:needs-attention`) if any required field is missing",
7326
+ "or contradictory.",
7327
+ "",
7328
+ "### Required Fields",
7329
+ "",
7330
+ "- **Category:** one of `BR` / `FR` / `NFR` / `TR` / `ADR` / `SEC` /",
7331
+ " `DR` / `INT` / `OPS` / `UX` / `MT`. Must match the category",
7332
+ " prefix in the requirement's title and file name.",
7333
+ "- **Tier:** one of `platform` / `industry` / `customer-workflow` /",
7334
+ " `consumer-app`. Must match the `tier:*` label applied to the",
7335
+ " issue.",
7336
+ "- **Output Path:** absolute-from-repo-root path ending in",
7337
+ " `<PREFIX>-<NNN>-<slug>.md` under the target category directory",
7338
+ " (for example,",
7339
+ " `docs/requirements/functional/FR-012-checkout-flow.md`).",
7340
+ "",
7341
+ "### Strongly Recommended",
7342
+ "",
7343
+ "- **Inputs / Read:** bullet list of source files the writer should",
7344
+ " consult \u2014 the upstream proposal file (when one exists), the",
7345
+ " BCM/source document(s) the proposal cites, and any related",
7346
+ " requirements the new document should trace to. Omit only for",
7347
+ " ad-hoc requirements where no upstream proposal exists; the",
7348
+ " writer will then treat the issue body itself as the input.",
7349
+ "",
7350
+ "### Missing Fields",
7351
+ "",
7352
+ "When an upstream producer cannot derive one of the required",
7353
+ "fields, it **must not** guess a value. Instead it opens the",
7354
+ "`req:write` issue with `status:needs-attention` (not",
7355
+ "`status:ready`) and includes a `Missing:` line listing the",
7356
+ "field(s) that could not be determined. For example:",
7357
+ "",
7358
+ "```",
7359
+ "Missing: Tier \u2014 source document has no tier metadata and the",
7360
+ "referencing requirement is cross-tier.",
7361
+ "```",
7362
+ "",
7363
+ "A human triages the issue, fills in the missing field, and flips",
7364
+ "the label to `status:ready` before the writer picks it up."
7365
+ ];
7366
+
7267
7367
  // src/agent/bundles/requirements-analyst.ts
7268
7368
  var requirementsAnalystSubAgent = {
7269
7369
  name: "requirements-analyst",
@@ -7494,6 +7594,7 @@ var requirementsAnalystSubAgent = {
7494
7594
  " ## Proposed: <PREFIX>-<NNN> \u2014 <Title>",
7495
7595
  "",
7496
7596
  " **Category:** <FR/BR/NFR/SEC/DR/INT/OPS/UX/MT/ADR/TR>",
7597
+ " **Tier:** <platform/industry/customer-workflow/consumer-app>",
7497
7598
  " **Priority:** <High/Normal/Low>",
7498
7599
  " **Source:** <document path and section>",
7499
7600
  "",
@@ -7547,6 +7648,41 @@ var requirementsAnalystSubAgent = {
7547
7648
  "**Budget:** No web searches. Issue creation + minor edits to source",
7548
7649
  "documents.",
7549
7650
  "",
7651
+ "### `req:write` issue schema",
7652
+ "",
7653
+ "The `req:write` issues this phase creates are picked up by the",
7654
+ "downstream `requirements-writer` agent, which parses a strict",
7655
+ "schema on intake. The authoritative schema is defined in the",
7656
+ "`requirements-writer` sub-agent prompt under **The `req:write`",
7657
+ "Issue Schema** \u2014 every `req:write` issue this phase opens must",
7658
+ "conform. The same schema is embedded in the",
7659
+ "`requirements-reviewer` follow-up generator so the three",
7660
+ "producers never drift apart.",
7661
+ "",
7662
+ ...REQ_WRITE_ISSUE_SCHEMA_SECTION,
7663
+ "",
7664
+ "**Deriving the three required fields from the proposal.** For",
7665
+ "every `req:write` issue this phase opens, the three fields come",
7666
+ "directly from the Phase 2 proposal entry:",
7667
+ "",
7668
+ "- **Category** \u2014 the proposal's `**Category:**` line.",
7669
+ "- **Tier** \u2014 the proposal's `**Tier:**` line (added in Phase 2).",
7670
+ " If the proposal omitted the Tier line (older proposals may),",
7671
+ " route the issue through `Missing:` rather than guessing.",
7672
+ "- **Output Path** \u2014",
7673
+ " `<REQUIREMENTS_ROOT>/<category-dir>/<PREFIX>-<NNN>-<slug>.md`,",
7674
+ " using the sequence number determined in Phase 2 step 4.",
7675
+ "",
7676
+ "**Validation step \u2014 required before opening the issue.** Before",
7677
+ "calling `gh issue create`, verify all three required fields are",
7678
+ "populated and internally consistent (Category matches title",
7679
+ "prefix, Tier matches `tier:*` label, Output Path filename starts",
7680
+ "with the Category prefix). If any field cannot be derived, open",
7681
+ "the issue with `status:needs-attention` (not `status:ready`) and",
7682
+ "include a `Missing: <field> \u2014 <one-line reason>` line so a human",
7683
+ "triaging the issue only has to supply the remaining value(s)",
7684
+ "before flipping the label to `status:ready`.",
7685
+ "",
7550
7686
  "### Steps",
7551
7687
  "",
7552
7688
  "1. **Read the proposals** from Phase 2.",
@@ -7555,21 +7691,26 @@ var requirementsAnalystSubAgent = {
7555
7691
  "",
7556
7692
  " All `type:requirement` issues default to `priority:medium` (override",
7557
7693
  " only if the proposal's priority was explicitly High or Low). Each",
7558
- " issue must also carry the `req:write` phase label so the downstream",
7559
- " `requirements-writer` bundle picks it up.",
7694
+ " issue must also carry the `req:write` phase label plus the matching",
7695
+ " `tier:*` label so the downstream `requirements-writer` bundle picks",
7696
+ " it up with the correct tier.",
7560
7697
  "",
7561
7698
  " ```bash",
7562
7699
  " gh issue create \\",
7563
7700
  ' --title "docs(<category>): <PREFIX>-<NNN> \u2014 <title>" \\',
7564
- ' --label "type:requirement" --label "req:write" --label "status:ready" --label "priority:medium" \\',
7701
+ ' --label "type:requirement" --label "req:write" --label "tier:<tier-slug>" --label "status:ready" --label "priority:medium" \\',
7565
7702
  ' --body "## Objective',
7566
7703
  " Write <PREFIX>-<NNN> \u2014 <title>.",
7567
7704
  "",
7705
+ " **Category:** <BR/FR/NFR/TR/ADR/SEC/DR/INT/OPS/UX/MT>",
7706
+ " **Tier:** <platform/industry/customer-workflow/consumer-app>",
7707
+ " **Output Path:** <REQUIREMENTS_ROOT>/<category-dir>/<PREFIX>-<NNN>-<slug>.md",
7708
+ "",
7568
7709
  " ## Context",
7569
7710
  " - **Gap identified by:** requirements scan of <source>",
7570
7711
  " - **Proposals file:** <RESEARCH_REQUIREMENTS_ROOT>/req-proposals-<scope>-<date>.md",
7571
7712
  "",
7572
- " ## Inputs",
7713
+ " ## Inputs / Read",
7573
7714
  " - **Depends on:** (none)",
7574
7715
  " - **Read:** <RESEARCH_REQUIREMENTS_ROOT>/req-proposals-<scope>-<date>.md, <source docs>",
7575
7716
  "",
@@ -7580,12 +7721,17 @@ var requirementsAnalystSubAgent = {
7580
7721
  " - [ ] Decision authority rules followed (direct write vs. proposed)",
7581
7722
  "",
7582
7723
  " ## Scope Size",
7583
- " small",
7584
- "",
7585
- " ## Output Path",
7586
- ' <REQUIREMENTS_ROOT>/<category>/<PREFIX>-<NNN>-<slug>.md"',
7724
+ ' small"',
7587
7725
  " ```",
7588
7726
  "",
7727
+ " When one of Category / Tier / Output Path could not be derived",
7728
+ " from the proposal (for example, the proposal omitted the Tier",
7729
+ " line), replace `status:ready` with `status:needs-attention` in",
7730
+ " the label list and add a `Missing: <field> \u2014 <reason>` line",
7731
+ " directly below the Output Path line in the body. Populate",
7732
+ " whichever of the three fields **could** be derived so a human",
7733
+ " triaging the issue has the minimum possible cleanup.",
7734
+ "",
7589
7735
  "3. **Update source documents.** In each BCM model doc or competitive",
7590
7736
  " analysis that was scanned, add a note in the project-relevance /",
7591
7737
  " strategic-implications section (whichever heading the source doc uses)",
@@ -7746,61 +7892,6 @@ var requirementsAnalystBundle = {
7746
7892
  ]
7747
7893
  };
7748
7894
 
7749
- // src/agent/bundles/requirements-taxonomy.ts
7750
- var REQUIREMENTS_TAXONOMY_TABLE_SECTION = [
7751
- "## The 11-Category Taxonomy",
7752
- "",
7753
- "All requirements follow the BIZBOK-aligned 11-category taxonomy",
7754
- "below. Getting requirements into the right category matters because",
7755
- "it determines which template applies, which standards inform it, and",
7756
- "how it traces to other requirements.",
7757
- "",
7758
- "| Category | Prefix | Directory (default) | Question it answers |",
7759
- "|----------|--------|---------------------|---------------------|",
7760
- "| Business Requirements | BR | `business/` | **Why** are we building this? What business value does it deliver? |",
7761
- "| Functional Requirements | FR | `functional/` | **What** does the system do? What is the user-visible behavior? |",
7762
- "| Non-Functional Requirements | NFR | `non-functional/` | **How well** must the system perform? What quality bar must it meet? |",
7763
- "| Technical Requirements | TR | `technical/` | **What technology** are we using, and why that one? |",
7764
- "| Architectural Decisions | ADR | `architectural-decisions/` | **What structural decision** are we making, and what are the trade-offs? |",
7765
- "| Security & Compliance | SEC | `security/` | **What must we protect**, and what rules govern that protection? |",
7766
- "| Data Requirements | DR | `data/` | **What data** do we store, how long, and how do we recover it? |",
7767
- "| Integration Requirements | INT | `integration/` | **What external systems** do we connect to, and how? |",
7768
- "| Operational Requirements | OPS | `operational/` | **How do we deploy, monitor, and respond** to incidents? |",
7769
- "| UX Requirements | UX | `ux/` | **How must the interface look, feel, and behave** for users? |",
7770
- "| Multi-Tenancy & Licensing | MT | `multi-tenancy/` | **How do we isolate tenants, gate features, and meter usage?** |",
7771
- "",
7772
- "All requirement documents live under `<REQUIREMENTS_ROOT>` in the",
7773
- "category directory shown above. Directory names are defaults \u2014",
7774
- "consuming projects may rename them, but the prefixes are universal."
7775
- ];
7776
- var REQUIREMENTS_TAXONOMY_DISAMBIGUATION_SECTION = [
7777
- "- **SEC vs NFR:** Protecting data, enforcing access control, or",
7778
- " meeting a regulation \u2192 SEC. System performance, uptime, or",
7779
- ' scalability \u2192 NFR. "99.9% uptime" is NFR; "audit logs for all',
7780
- ' admin actions" is SEC.',
7781
- '- **TR vs ADR:** A TR pins down a specific technology choice ("use',
7782
- ' PostgreSQL 16+"). An ADR records a structural decision with',
7783
- ' context, trade-offs, and alternatives ("why row-level isolation',
7784
- ' over schema-per-tenant"). TRs often follow from ADRs.',
7785
- "- **FR vs INT:** What the user experiences \u2192 FR. How two systems",
7786
- ' communicate \u2192 INT. "User can pay with a credit card" is FR;',
7787
- ' "Stripe Checkout API integration for payment processing" is INT.',
7788
- "- **DR vs SEC:** What data exists, how long we keep it, and how we",
7789
- " recover it \u2192 DR. Who can access it and how it's protected \u2192 SEC.",
7790
- " These often cross-reference each other.",
7791
- "- **NFR vs OPS:** A measurable target the system must meet \u2192 NFR.",
7792
- ' The tooling and processes to run the system \u2192 OPS. "p99 latency',
7793
- ' < 200ms" is NFR; "Datadog APM for latency monitoring" is OPS.'
7794
- ];
7795
- var REQUIREMENTS_TIER_TABLE_SECTION = [
7796
- "| Tier | Slug | When to use |",
7797
- "|------|------|-------------|",
7798
- "| **Platform** | `platform` | Core platform services \u2014 APIs, tenant isolation, auth, event bus, shared infrastructure |",
7799
- "| **Industry** | `industry` | Vertical-specific capabilities not every tenant needs |",
7800
- "| **Customer Workflow** | `customer-workflow` | Business logic tenants configure within the platform \u2014 approval chains, notification rules, intake processes |",
7801
- "| **Consumer Application** | `consumer-app` | UI/UX and integrations in external front-ends/systems consuming the platform's APIs |"
7802
- ];
7803
-
7804
7895
  // src/agent/bundles/requirements-writer.ts
7805
7896
  var TEMPLATE_BR = `---
7806
7897
  title: "BR-NNN: [Business Requirement Title]"
@@ -10079,6 +10170,19 @@ var requirementsWriterSubAgent = {
10079
10170
  "",
10080
10171
  "---",
10081
10172
  "",
10173
+ "## The `req:write` Issue Schema",
10174
+ "",
10175
+ "This section is the **authoritative schema** for `req:write` issue",
10176
+ "bodies. Upstream producers (the `requirements-analyst` trace phase,",
10177
+ "the `requirements-reviewer` follow-up generator, and any human",
10178
+ "authoring a `req:write` issue directly) must embed or link to this",
10179
+ "same schema so the three required fields are always present when",
10180
+ "the writer picks the issue up.",
10181
+ "",
10182
+ ...REQ_WRITE_ISSUE_SCHEMA_SECTION,
10183
+ "",
10184
+ "---",
10185
+ "",
10082
10186
  "## The `req:write` Phase",
10083
10187
  "",
10084
10188
  "**Goal:** Read the proposal that produced this issue, write a single",
@@ -10093,14 +10197,25 @@ var requirementsWriterSubAgent = {
10093
10197
  "",
10094
10198
  "### Steps",
10095
10199
  "",
10096
- "1. **Parse the issue.** The `req:write` issue body must include:",
10097
- " - **Category** (`BR`/`FR`/`NFR`/`TR`/`ADR`/`SEC`/`DR`/`INT`/`OPS`/`UX`/`MT`)",
10098
- " - **Tier** (`platform`/`industry`/`customer-workflow`/`consumer-app`)",
10099
- " - **Output Path** under `<REQUIREMENTS_ROOT>/<category-dir>/<PREFIX>-<NNN>-<slug>.md`",
10100
- " - **Inputs / Read** \u2014 the upstream proposals file and any source",
10101
- " documents",
10102
- " If any of these are missing or contradictory, comment on the",
10103
- " issue, add `status:needs-attention`, and stop without writing.",
10200
+ "1. **Parse the issue.** The `req:write` issue body follows the",
10201
+ " authoritative schema in the",
10202
+ " [The `req:write` Issue Schema](#the-reqwrite-issue-schema)",
10203
+ " section below. Before writing, verify every required field",
10204
+ " (Category, Tier, Output Path) is present and internally",
10205
+ " consistent:",
10206
+ "",
10207
+ " - Category matches the prefix on the requirement title and on",
10208
+ " the Output Path filename.",
10209
+ " - Tier matches the `tier:*` label applied to the issue.",
10210
+ " - Output Path sits under",
10211
+ " `<REQUIREMENTS_ROOT>/<category-dir>/<PREFIX>-<NNN>-<slug>.md`.",
10212
+ "",
10213
+ " If any required field is missing, contradictory, or the issue",
10214
+ " already carries `status:needs-attention` with a `Missing:` line",
10215
+ " (upstream could not derive it), comment on the issue with",
10216
+ " which field is wrong, ensure `status:needs-attention` is set,",
10217
+ " and stop without writing. A human triages before the writer",
10218
+ " tries again.",
10104
10219
  "",
10105
10220
  "2. **Read the proposal.** Open the proposals file referenced in the",
10106
10221
  " issue inputs (under `<RESEARCH_REQUIREMENTS_ROOT>`). Find the",
@@ -10395,7 +10510,7 @@ var requirementsWriterBundle = {
10395
10510
  // src/agent/bundles/requirements-reviewer.ts
10396
10511
  var requirementsReviewerSubAgent = {
10397
10512
  name: "requirements-reviewer",
10398
- description: "Audits and deprecates existing requirement documents (BR, FR, NFR, TR, ADR, SEC, DR, INT, OPS, UX, MT). In `req:review` mode, runs the 11-check audit (structural compliance, categorization, traceability, cross-reference integrity, sequence integrity, content quality, registry sync, decision-authority compliance, tier classification, cross-referencing conventions) and produces a report grouped by Critical / Warning / Info. In `req:deprecate` mode, transitions target documents to `Deprecated` or `Superseded`, updates the category index row, and files `req:write` follow-ups for every back-reference so the writer can rewrite them. One phase per session.",
10513
+ description: "Audits and deprecates existing requirement documents (BR, FR, NFR, TR, ADR, SEC, DR, INT, OPS, UX, MT). In `req:review` mode, runs the 12-check audit (structural compliance, categorization, traceability, cross-reference integrity, sequence integrity, content quality, registry sync, decision-authority compliance, tier classification, cross-referencing conventions, stale `Proposed` ADR/TR decisions) and produces a report grouped by Critical / Warning / Info (plus a dedicated Stale decisions section). In `req:deprecate` mode, transitions target documents to `Deprecated` or `Superseded`, updates the category index row, and files `req:write` follow-ups for every back-reference so the writer can rewrite them. One phase per session.",
10399
10514
  model: AGENT_MODEL.POWERFUL,
10400
10515
  maxTurns: 80,
10401
10516
  platforms: { cursor: { exclude: true } },
@@ -10522,6 +10637,7 @@ var requirementsReviewerSubAgent = {
10522
10637
  "| `<REVIEW_REPORTS_ROOT>` | Where review reports are written | `docs/research/reviews/` |",
10523
10638
  `| \`<TEMPLATES_ROOT>\` | Where the writer bundle ships category templates (read-only for this agent) | \`${REQUIREMENTS_WRITER_PATHS.templatesRoot}\` |`,
10524
10639
  `| \`<STANDARDS_REF>\` | Standards & frameworks reference shipped by the writer bundle | \`${REQUIREMENTS_WRITER_PATHS.standardsRef}\` |`,
10640
+ "| `<STALE_PROPOSED_THRESHOLD_DAYS>` | Age (in days) after which a `Proposed` ADR/TR is flagged as a stale decision by Check 12 | `14` |",
10525
10641
  "",
10526
10642
  "If `docs/project-context.md` specifies a different requirements",
10527
10643
  "tree, prefer that. Otherwise fall back to the defaults above.",
@@ -10571,7 +10687,7 @@ var requirementsReviewerSubAgent = {
10571
10687
  "",
10572
10688
  "## Review Checklist",
10573
10689
  "",
10574
- "Apply the following 11 checks. Each check produces zero or more",
10690
+ "Apply the following 12 checks. Each check produces zero or more",
10575
10691
  "findings. Findings are graded Critical / Warning / Info using the",
10576
10692
  "severity ladder in the next section.",
10577
10693
  "",
@@ -10816,6 +10932,60 @@ var requirementsReviewerSubAgent = {
10816
10932
  " reverse-link structure (e.g., a `referencedIn.meetings[]`",
10817
10933
  " frontmatter block) and that structure is in active use.",
10818
10934
  "",
10935
+ "### 12. Stale Proposed Decisions",
10936
+ "",
10937
+ "ADR and TR documents ship as `Status: Proposed` because they",
10938
+ "encode architectural or technology decisions that require explicit",
10939
+ "human acceptance (see Check 9 and the `requirements-writer`",
10940
+ "decision-authority rules). Once `Proposed`, there is no automatic",
10941
+ "signal that surfaces long-`Proposed` documents for decision \u2014 the",
10942
+ "backlog silently accumulates. Check 12 surfaces them.",
10943
+ "",
10944
+ "For every document under `<REQUIREMENTS_ROOT>` whose category is",
10945
+ "**ADR** or **TR** and whose `Status` is `Proposed`:",
10946
+ "",
10947
+ "- Determine the document's last-touched date. Prefer the YAML",
10948
+ " frontmatter `updated` field when present. If frontmatter does",
10949
+ " not carry an `updated` field, fall back to the most recent entry",
10950
+ " in the `## Revision History` section. If neither exists, fall",
10951
+ " back to `git log -1 --format=%cI -- <path>` for the file.",
10952
+ "- Compare that date to today. If the document has carried",
10953
+ " `Status: Proposed` for longer than",
10954
+ " `<STALE_PROPOSED_THRESHOLD_DAYS>` days (default 14), record a",
10955
+ " **Warning** finding that names the document, the age in days,",
10956
+ " the threshold, and the source used for the last-touched date.",
10957
+ "- Do **not** flag `Proposed` ADRs or TRs that are below the",
10958
+ " threshold \u2014 they are in active decision and not stale.",
10959
+ "- Do **not** auto-transition any status. Deprecation and",
10960
+ " acceptance both remain human decisions: Check 12 only surfaces",
10961
+ " the backlog for the human running `/review-requirements` (or",
10962
+ " for the follow-up issue it files) to act on.",
10963
+ "",
10964
+ "The threshold placeholder `<STALE_PROPOSED_THRESHOLD_DAYS>` is",
10965
+ "configurable \u2014 override it in the `req:review` issue body, in",
10966
+ "`docs/project-context.md`, or via `agentConfig.rules`. The default",
10967
+ "of 14 days sits above the orchestrator's existing 72h / 168h stale",
10968
+ "thresholds for `status:in-progress` / `status:blocked` and fits",
10969
+ "the pace at which architectural decisions are typically ratified.",
10970
+ "",
10971
+ "Findings from Check 12 describe a decision the human must make \u2014",
10972
+ "not an edit to the requirement document itself. Follow-up routing",
10973
+ "is therefore different from Checks 3 and 4:",
10974
+ "",
10975
+ "- Surface every stale `Proposed` ADR/TR in a distinct",
10976
+ " **Stale decisions** section in the review report (see Reporting",
10977
+ " Format below), separate from Critical / Warning / Info.",
10978
+ "- File **one** follow-up issue covering the stale decisions found",
10979
+ " in this review. Title:",
10980
+ " `req(review): decide on stale Proposed ADR/TR documents`.",
10981
+ " Labels: `type:requirement`, `req:review`, `priority:medium`,",
10982
+ " `status:needs-attention`. Body must list each stale document",
10983
+ " path, its age in days, and a link back to the review report.",
10984
+ " Do **not** file one follow-up per document \u2014 humans triage the",
10985
+ " backlog in a single pass.",
10986
+ "- When no stale documents are found, omit the Stale decisions",
10987
+ " section entirely and do not file the follow-up issue.",
10988
+ "",
10819
10989
  "---",
10820
10990
  "",
10821
10991
  "## Severity Ladder",
@@ -10851,6 +11021,13 @@ var requirementsReviewerSubAgent = {
10851
11021
  "- Missing cross-tier traceability; missing Implementor / Customer",
10852
11022
  " fields on Customer Workflow / Consumer Application requirements",
10853
11023
  " when the project tracks those fields",
11024
+ "- Stale `Proposed` ADR/TR documents that have carried the",
11025
+ " `Proposed` status longer than",
11026
+ " `<STALE_PROPOSED_THRESHOLD_DAYS>` (default 14) days. The",
11027
+ " underlying document is valid; only the absence of human",
11028
+ " decision is stale, so these are reported in the report's",
11029
+ " dedicated **Stale decisions** section rather than inline in",
11030
+ " the Warning list.",
10854
11031
  "",
10855
11032
  "### Info (Consider)",
10856
11033
  "",
@@ -10894,6 +11071,20 @@ var requirementsReviewerSubAgent = {
10894
11071
  "1. **[<file path>] <short title>** `Info`",
10895
11072
  " ...",
10896
11073
  "",
11074
+ "## Stale decisions",
11075
+ "",
11076
+ "*Omit this section entirely when Check 12 found no stale",
11077
+ "`Proposed` ADR/TR documents.*",
11078
+ "",
11079
+ "| Document | Age (days) | Threshold | Last-touched source |",
11080
+ "|----------|------------|-----------|---------------------|",
11081
+ "| `<file path>` | N | <STALE_PROPOSED_THRESHOLD_DAYS> | frontmatter `updated` / revision history / git log |",
11082
+ "",
11083
+ "Human decision required for each row. A single follow-up",
11084
+ "`req:review` issue (labels `type:requirement`, `req:review`,",
11085
+ "`priority:medium`, `status:needs-attention`) is filed to",
11086
+ "track triage; see Check 12 for the exact follow-up contract.",
11087
+ "",
10897
11088
  "## Review Summary",
10898
11089
  "",
10899
11090
  "| Severity | Count |",
@@ -10901,6 +11092,7 @@ var requirementsReviewerSubAgent = {
10901
11092
  "| Critical | N |",
10902
11093
  "| Warning | N |",
10903
11094
  "| Info | N |",
11095
+ "| Stale decisions | N |",
10904
11096
  "",
10905
11097
  "**Categories reviewed:** [list]",
10906
11098
  "**Documents reviewed:** N",
@@ -10962,7 +11154,7 @@ var requirementsReviewerSubAgent = {
10962
11154
  "1. Read scope from the `req:review` issue.",
10963
11155
  "2. Read the matching templates from `<TEMPLATES_ROOT>` for every",
10964
11156
  " category in scope.",
10965
- "3. Run the 11 checks. For audits >10 documents, write the",
11157
+ "3. Run the 12 checks. For audits >10 documents, write the",
10966
11158
  " verification script to disk first and run it.",
10967
11159
  "4. Write the report to",
10968
11160
  " `<REVIEW_REPORTS_ROOT>/review-<scope>-YYYY-MM-DD.md`.",
@@ -10992,7 +11184,9 @@ var requirementsReviewerSubAgent = {
10992
11184
  " `requirements-writer` agent picks it up to revise the",
10993
11185
  " document). Only the writer is scoped to edit requirement",
10994
11186
  " documents, so anything that requires an in-place edit under",
10995
- " `<REQUIREMENTS_ROOT>` routes here.",
11187
+ " `<REQUIREMENTS_ROOT>` routes here. `req:write` follow-ups",
11188
+ " must also carry the matching `tier:*` label and an issue",
11189
+ " body that conforms to the `req:write` issue schema below.",
10996
11190
  " - Missing traceability in **source documents** \u2014 BCM model",
10997
11191
  " docs, competitive-analysis notes, product-roadmap entries,",
10998
11192
  " meeting extracts \u2014 that should link forward to an existing",
@@ -11013,9 +11207,81 @@ var requirementsReviewerSubAgent = {
11013
11207
  "- Adds `status:ready` (or `status:blocked` when the finding",
11014
11208
  " declares a `Depends on: #N` on another open issue)",
11015
11209
  "",
11210
+ "**Check 12 exception \u2014 stale `Proposed` ADR/TR triage.** Check 12",
11211
+ "findings are the one case where follow-up flows through a new",
11212
+ "`req:review` issue rather than `req:write` / `req:trace` /",
11213
+ "`req:scan`. The finding is a decision a human must make, not an",
11214
+ "edit to a requirement document, so:",
11215
+ "",
11216
+ "- File **one** aggregated follow-up (not one per document). The",
11217
+ " title is",
11218
+ " `req(review): decide on stale Proposed ADR/TR documents`.",
11219
+ "- Labels: `type:requirement`, `req:review`, `priority:medium`,",
11220
+ " `status:needs-attention`.",
11221
+ "- Body lists every stale document surfaced in this review with",
11222
+ " its path, age in days, and the threshold used, and links back",
11223
+ " to the Stale decisions section of the review report.",
11224
+ "- This is the **only** case in which the reviewer opens a",
11225
+ " `req:review` issue \u2014 it is explicitly not self-referential",
11226
+ " because the new issue triages decisions rather than triggering",
11227
+ " another review.",
11228
+ "- The `req:write` follow-up schema below does **not** apply to",
11229
+ " this Check 12 issue; the schema governs `req:write` payloads,",
11230
+ " and this follow-up is a `req:review` triage item.",
11231
+ "",
11232
+ "### `req:write` follow-up schema",
11233
+ "",
11234
+ "Because this bundle is the second-largest producer of `req:write`",
11235
+ "issues (the analyst's trace phase is the first), every `req:write`",
11236
+ "follow-up opened in either the review phase or the deprecation",
11237
+ "phase must satisfy the schema the writer parses on intake:",
11238
+ "",
11239
+ ...REQ_WRITE_ISSUE_SCHEMA_SECTION,
11240
+ "",
11241
+ "**Deriving the three required fields from the target document.**",
11242
+ "For every structural-repair follow-up the reviewer generates, the",
11243
+ "three fields come directly from the requirement document being",
11244
+ "edited:",
11245
+ "",
11246
+ "- **Category** \u2014 read the category prefix from the document's",
11247
+ " filename (`FR-012-...` \u2192 `FR`). Confirm against the frontmatter",
11248
+ " / Metadata table `ID` row and the document's `# Heading`. If",
11249
+ " the three disagree, route through `Missing:` with the",
11250
+ " disagreement noted rather than picking one.",
11251
+ "- **Tier** \u2014 read the Metadata table `Tier` row. Normalize to the",
11252
+ " slug form (`platform`, `industry`, `customer-workflow`,",
11253
+ " `consumer-app`). If the Tier row is missing, empty, or set to",
11254
+ " a value outside the four-tier taxonomy, route through",
11255
+ " `Missing:`.",
11256
+ "- **Output Path** \u2014 the current absolute-from-repo-root path of",
11257
+ " the document being edited. The writer edits in place; the path",
11258
+ " does not change for a structural repair.",
11259
+ "",
11260
+ "For deprecation back-reference follow-ups, the three fields come",
11261
+ "from the **referencing** document (the one that still mentions",
11262
+ "the deprecated ID), not the deprecated target itself.",
11263
+ "",
11264
+ "**Validation step \u2014 required before opening the issue.** The",
11265
+ "reviewer asserts all three required fields are populated before",
11266
+ "it calls `gh issue create`. If any field cannot be derived:",
11267
+ "",
11268
+ "1. Open the follow-up with `status:needs-attention` (not",
11269
+ " `status:ready`).",
11270
+ "2. Include a `Missing: <field> \u2014 <one-line reason>` line at the",
11271
+ " top of the body explaining which field could not be",
11272
+ " determined and why (e.g., `Missing: Tier \u2014 Metadata table",
11273
+ " has no Tier row and the document predates the four-tier",
11274
+ " classification`).",
11275
+ "3. Populate whichever of the three fields **could** be derived",
11276
+ " so a human triaging the issue only has to supply the",
11277
+ " remaining value(s) before flipping the label to",
11278
+ " `status:ready`.",
11279
+ "",
11016
11280
  "**Do NOT create:**",
11017
11281
  "",
11018
- "- `req:review` issues \u2014 that would be self-referential",
11282
+ "- `req:review` issues for any reason other than the Check 12",
11283
+ " stale-decisions triage documented above \u2014 that would be",
11284
+ " self-referential",
11019
11285
  "- `bcm:*`, `people:*`, `company:*`, `software:*`, `research:*`,",
11020
11286
  " or `industry:*` issues \u2014 those belong to their respective",
11021
11287
  " bundles. If the review surfaces work for one of those bundles,",
@@ -11190,15 +11456,26 @@ var requirementsReviewerSubAgent = {
11190
11456
  " references that a single writer session can address together).",
11191
11457
  "- The issue title must be",
11192
11458
  " `req(deprecate): update references to <deprecated-ID> in <referencing-ID>`.",
11193
- "- The body must include: the referencing document path, the",
11194
- " deprecated document path, the successor path (when applicable),",
11195
- " the list of line ranges that mention the deprecated ID, the",
11196
- " `req:deprecate` issue number, and a short instruction asking the",
11197
- " writer to either remove the reference, point it at the successor,",
11198
- " or convert it to a historical note (the writer decides per",
11459
+ "- The body must conform to the `req:write` issue schema defined",
11460
+ " in the review phase's **`req:write` follow-up schema** section",
11461
+ " above: Category, Tier, and Output Path derived from the",
11462
+ " **referencing** document (not the deprecated target) via the",
11463
+ " same rules \u2014 prefix from filename, Tier from the Metadata",
11464
+ " table, Output Path is the referencing document's current path.",
11465
+ " In addition, the body must include: the deprecated document",
11466
+ " path, the successor path (when applicable), the list of line",
11467
+ " ranges that mention the deprecated ID, the `req:deprecate`",
11468
+ " issue number, and a short instruction asking the writer to",
11469
+ " either remove the reference, point it at the successor, or",
11470
+ " convert it to a historical note (the writer decides per",
11199
11471
  " reference).",
11200
- "- Labels: `type:requirement`, `req:write`, `priority:medium`,",
11201
- " `status:ready`.",
11472
+ "- Labels: `type:requirement`, `req:write`, the matching",
11473
+ " `tier:*` label derived from the referencing document's Tier,",
11474
+ " `priority:medium`, `status:ready`.",
11475
+ "- If any of Category / Tier / Output Path cannot be derived from",
11476
+ " the referencing document, open the follow-up with",
11477
+ " `status:needs-attention` and a `Missing:` line, per the same",
11478
+ " validation rule that applies in the review phase.",
11202
11479
  "- Body must include `Depends on: #<req:deprecate issue number>`",
11203
11480
  " when the rewrite should wait for the deprecation to land, or",
11204
11481
  " omit that line when the rewrite can run in parallel.",
@@ -11285,7 +11562,7 @@ var requirementsReviewerSubAgent = {
11285
11562
  };
11286
11563
  var reviewRequirementsSkill = {
11287
11564
  name: "review-requirements",
11288
- description: "Audit existing requirement documents (BR / FR / NFR / TR / ADR / SEC / DR / INT / OPS / UX / MT) for structural compliance, categorization, traceability, cross-reference integrity, sequence integrity, content quality, registry sync, decision-authority compliance, tier classification, and cross-referencing conventions. Supports four scopes (full audit, category, single document, targeted check) and dispatches the requirements-reviewer agent. Audits documents \u2014 never writes them. Soft dependency: expects requirement templates at `" + REQUIREMENTS_WRITER_PATHS.templatesRoot + "`, shipped by the requirements-writer bundle.",
11565
+ description: "Audit existing requirement documents (BR / FR / NFR / TR / ADR / SEC / DR / INT / OPS / UX / MT) for structural compliance, categorization, traceability, cross-reference integrity, sequence integrity, content quality, registry sync, decision-authority compliance, tier classification, cross-referencing conventions, and stale `Proposed` ADR/TR decisions. Supports four scopes (full audit, category, single document, targeted check) and dispatches the requirements-reviewer agent. Audits documents \u2014 never writes them. Soft dependency: expects requirement templates at `" + REQUIREMENTS_WRITER_PATHS.templatesRoot + "`, shipped by the requirements-writer bundle.",
11289
11566
  disableModelInvocation: true,
11290
11567
  userInvocable: true,
11291
11568
  context: "fork",
@@ -11317,9 +11594,10 @@ var reviewRequirementsSkill = {
11317
11594
  "- `category:<slug>` \u2014 audit one category directory (e.g.,",
11318
11595
  " `category:functional` audits every FR)",
11319
11596
  "- `doc:<path>` \u2014 audit one specific requirement file",
11320
- "- `check:<n>[,<n>...]` \u2014 run one or more checks (1\u201311) across the",
11597
+ "- `check:<n>[,<n>...]` \u2014 run one or more checks (1\u201312) across the",
11321
11598
  " documents in scope (e.g., `check:4` runs cross-reference",
11322
- " integrity only)",
11599
+ " integrity only, `check:12` runs the stale-proposed-decision",
11600
+ " audit only)",
11323
11601
  "",
11324
11602
  "Optional extensions in the issue body:",
11325
11603
  "",
@@ -11327,6 +11605,9 @@ var reviewRequirementsSkill = {
11327
11605
  "- `requirements-root: <path>` \u2014 override `<REQUIREMENTS_ROOT>`",
11328
11606
  "- `targets: <glob>` \u2014 restrict the document set with a glob",
11329
11607
  " pattern relative to `<REQUIREMENTS_ROOT>`",
11608
+ "- `stale-proposed-threshold-days: <n>` \u2014 override the default",
11609
+ " 14-day threshold used by Check 12 (stale `Proposed` ADR/TR",
11610
+ " decisions) for this review",
11330
11611
  "",
11331
11612
  "## Default Paths",
11332
11613
  "",
@@ -11345,10 +11626,12 @@ var reviewRequirementsSkill = {
11345
11626
  " scope, the requirements root (or accept the default), and the",
11346
11627
  " output path.",
11347
11628
  "2. Execute the review phase of the requirements-reviewer agent.",
11348
- "3. The agent runs the 11-check audit, writes a structured report",
11349
- " grouped by Critical / Warning / Info, files follow-up issues",
11350
- " for actionable findings, and comments on the `req:review`",
11351
- " issue with the summary.",
11629
+ "3. The agent runs the 12-check audit, writes a structured report",
11630
+ " grouped by Critical / Warning / Info (plus a separate",
11631
+ " **Stale decisions** section when Check 12 surfaces stale",
11632
+ " `Proposed` ADR/TR documents), files follow-up issues for",
11633
+ " actionable findings, and comments on the `req:review` issue",
11634
+ " with the summary.",
11352
11635
  "",
11353
11636
  "## Audits >10 Documents",
11354
11637
  "",
@@ -11368,6 +11651,11 @@ var reviewRequirementsSkill = {
11368
11651
  "- Follow-up GitHub issues for every Critical and Warning finding,",
11369
11652
  " carrying the appropriate phase label (`req:write`, `req:trace`,",
11370
11653
  " or `req:scan`) for the downstream agent that should act",
11654
+ "- An aggregated `req:review` follow-up issue labeled",
11655
+ " `status:needs-attention` when Check 12 surfaces stale `Proposed`",
11656
+ " ADR/TR documents (one issue per review, not one per document);",
11657
+ " the review report also includes a dedicated **Stale decisions**",
11658
+ " section in that case",
11371
11659
  "- A summary comment on the originating `req:review` issue"
11372
11660
  ].join("\n")
11373
11661
  };
@@ -11475,7 +11763,7 @@ var deprecateRequirementSkill = {
11475
11763
  };
11476
11764
  var requirementsReviewerBundle = {
11477
11765
  name: "requirements-reviewer",
11478
- description: "Requirements reviewer agent bundle. Audits existing requirement documents (BR, FR, NFR, TR, ADR, SEC, DR, INT, OPS, UX, MT) via the 11-check review phase, and transitions requirements to `Deprecated` or `Superseded` via the deprecation phase (narrow writes to Status, Revision History, Superseded-by, and category index row, with `req:write` follow-ups for every back-reference). Reads templates from the requirements-writer bundle's reference directory; ships no templates of its own.",
11766
+ description: "Requirements reviewer agent bundle. Audits existing requirement documents (BR, FR, NFR, TR, ADR, SEC, DR, INT, OPS, UX, MT) via the 12-check review phase (including Check 12: stale `Proposed` ADR/TR decisions), and transitions requirements to `Deprecated` or `Superseded` via the deprecation phase (narrow writes to Status, Revision History, Superseded-by, and category index row, with `req:write` follow-ups for every back-reference). Reads templates from the requirements-writer bundle's reference directory; ships no templates of its own.",
11479
11767
  appliesWhen: () => true,
11480
11768
  rules: [
11481
11769
  {
@@ -11500,14 +11788,26 @@ var requirementsReviewerBundle = {
11500
11788
  "Use `/review-requirements <scope>` to audit existing requirement",
11501
11789
  "documents. Four scopes are supported: `full` (every document),",
11502
11790
  "`category:<slug>` (one category directory), `doc:<path>` (one",
11503
- "specific document), and `check:<n>` (one or more of the 11",
11791
+ "specific document), and `check:<n>` (one or more of the 12",
11504
11792
  "checks across the documents in scope).",
11505
11793
  "",
11794
+ "Check 12 flags ADR and TR documents that have carried",
11795
+ "`Status: Proposed` longer than",
11796
+ "`<STALE_PROPOSED_THRESHOLD_DAYS>` days (default 14, configurable",
11797
+ "via the `req:review` issue body, `docs/project-context.md`, or",
11798
+ "`agentConfig.rules`). Stale decisions are reported in a separate",
11799
+ "**Stale decisions** section of the review report and trigger one",
11800
+ "aggregated `req:review` follow-up issue labeled",
11801
+ "`status:needs-attention` so a human can triage the backlog. The",
11802
+ "reviewer never auto-transitions status \u2014 acceptance and",
11803
+ "deprecation both remain human decisions.",
11804
+ "",
11506
11805
  "The review phase produces **review reports and follow-up issues",
11507
11806
  "only** \u2014 it never edits requirement documents, capability",
11508
11807
  "models, or research notes. It files follow-up issues with the",
11509
- "appropriate phase label (`req:write`, `req:trace`, or",
11510
- "`req:scan`) for the downstream agent to pick up.",
11808
+ "appropriate phase label (`req:write`, `req:trace`, `req:scan`,",
11809
+ "or \u2014 only for Check 12 stale-decision triage \u2014 `req:review`)",
11810
+ "for the downstream agent or human to pick up.",
11511
11811
  "",
11512
11812
  "For audits covering more than 10 documents, the reviewer writes",
11513
11813
  "a read-only Python verification script alongside the report and",