@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.js CHANGED
@@ -7342,6 +7342,106 @@ var projenBundle = {
7342
7342
  ]
7343
7343
  };
7344
7344
 
7345
+ // src/agent/bundles/requirements-taxonomy.ts
7346
+ var REQUIREMENTS_TAXONOMY_TABLE_SECTION = [
7347
+ "## The 11-Category Taxonomy",
7348
+ "",
7349
+ "All requirements follow the BIZBOK-aligned 11-category taxonomy",
7350
+ "below. Getting requirements into the right category matters because",
7351
+ "it determines which template applies, which standards inform it, and",
7352
+ "how it traces to other requirements.",
7353
+ "",
7354
+ "| Category | Prefix | Directory (default) | Question it answers |",
7355
+ "|----------|--------|---------------------|---------------------|",
7356
+ "| Business Requirements | BR | `business/` | **Why** are we building this? What business value does it deliver? |",
7357
+ "| Functional Requirements | FR | `functional/` | **What** does the system do? What is the user-visible behavior? |",
7358
+ "| Non-Functional Requirements | NFR | `non-functional/` | **How well** must the system perform? What quality bar must it meet? |",
7359
+ "| Technical Requirements | TR | `technical/` | **What technology** are we using, and why that one? |",
7360
+ "| Architectural Decisions | ADR | `architectural-decisions/` | **What structural decision** are we making, and what are the trade-offs? |",
7361
+ "| Security & Compliance | SEC | `security/` | **What must we protect**, and what rules govern that protection? |",
7362
+ "| Data Requirements | DR | `data/` | **What data** do we store, how long, and how do we recover it? |",
7363
+ "| Integration Requirements | INT | `integration/` | **What external systems** do we connect to, and how? |",
7364
+ "| Operational Requirements | OPS | `operational/` | **How do we deploy, monitor, and respond** to incidents? |",
7365
+ "| UX Requirements | UX | `ux/` | **How must the interface look, feel, and behave** for users? |",
7366
+ "| Multi-Tenancy & Licensing | MT | `multi-tenancy/` | **How do we isolate tenants, gate features, and meter usage?** |",
7367
+ "",
7368
+ "All requirement documents live under `<REQUIREMENTS_ROOT>` in the",
7369
+ "category directory shown above. Directory names are defaults \u2014",
7370
+ "consuming projects may rename them, but the prefixes are universal."
7371
+ ];
7372
+ var REQUIREMENTS_TAXONOMY_DISAMBIGUATION_SECTION = [
7373
+ "- **SEC vs NFR:** Protecting data, enforcing access control, or",
7374
+ " meeting a regulation \u2192 SEC. System performance, uptime, or",
7375
+ ' scalability \u2192 NFR. "99.9% uptime" is NFR; "audit logs for all',
7376
+ ' admin actions" is SEC.',
7377
+ '- **TR vs ADR:** A TR pins down a specific technology choice ("use',
7378
+ ' PostgreSQL 16+"). An ADR records a structural decision with',
7379
+ ' context, trade-offs, and alternatives ("why row-level isolation',
7380
+ ' over schema-per-tenant"). TRs often follow from ADRs.',
7381
+ "- **FR vs INT:** What the user experiences \u2192 FR. How two systems",
7382
+ ' communicate \u2192 INT. "User can pay with a credit card" is FR;',
7383
+ ' "Stripe Checkout API integration for payment processing" is INT.',
7384
+ "- **DR vs SEC:** What data exists, how long we keep it, and how we",
7385
+ " recover it \u2192 DR. Who can access it and how it's protected \u2192 SEC.",
7386
+ " These often cross-reference each other.",
7387
+ "- **NFR vs OPS:** A measurable target the system must meet \u2192 NFR.",
7388
+ ' The tooling and processes to run the system \u2192 OPS. "p99 latency',
7389
+ ' < 200ms" is NFR; "Datadog APM for latency monitoring" is OPS.'
7390
+ ];
7391
+ var REQUIREMENTS_TIER_TABLE_SECTION = [
7392
+ "| Tier | Slug | When to use |",
7393
+ "|------|------|-------------|",
7394
+ "| **Platform** | `platform` | Core platform services \u2014 APIs, tenant isolation, auth, event bus, shared infrastructure |",
7395
+ "| **Industry** | `industry` | Vertical-specific capabilities not every tenant needs |",
7396
+ "| **Customer Workflow** | `customer-workflow` | Business logic tenants configure within the platform \u2014 approval chains, notification rules, intake processes |",
7397
+ "| **Consumer Application** | `consumer-app` | UI/UX and integrations in external front-ends/systems consuming the platform's APIs |"
7398
+ ];
7399
+ var REQ_WRITE_ISSUE_SCHEMA_SECTION = [
7400
+ "The body of every `req:write` issue **must** declare the three",
7401
+ "fields below. The downstream `requirements-writer` agent parses",
7402
+ "them on intake and will refuse to write a document (and flag the",
7403
+ "issue `status:needs-attention`) if any required field is missing",
7404
+ "or contradictory.",
7405
+ "",
7406
+ "### Required Fields",
7407
+ "",
7408
+ "- **Category:** one of `BR` / `FR` / `NFR` / `TR` / `ADR` / `SEC` /",
7409
+ " `DR` / `INT` / `OPS` / `UX` / `MT`. Must match the category",
7410
+ " prefix in the requirement's title and file name.",
7411
+ "- **Tier:** one of `platform` / `industry` / `customer-workflow` /",
7412
+ " `consumer-app`. Must match the `tier:*` label applied to the",
7413
+ " issue.",
7414
+ "- **Output Path:** absolute-from-repo-root path ending in",
7415
+ " `<PREFIX>-<NNN>-<slug>.md` under the target category directory",
7416
+ " (for example,",
7417
+ " `docs/requirements/functional/FR-012-checkout-flow.md`).",
7418
+ "",
7419
+ "### Strongly Recommended",
7420
+ "",
7421
+ "- **Inputs / Read:** bullet list of source files the writer should",
7422
+ " consult \u2014 the upstream proposal file (when one exists), the",
7423
+ " BCM/source document(s) the proposal cites, and any related",
7424
+ " requirements the new document should trace to. Omit only for",
7425
+ " ad-hoc requirements where no upstream proposal exists; the",
7426
+ " writer will then treat the issue body itself as the input.",
7427
+ "",
7428
+ "### Missing Fields",
7429
+ "",
7430
+ "When an upstream producer cannot derive one of the required",
7431
+ "fields, it **must not** guess a value. Instead it opens the",
7432
+ "`req:write` issue with `status:needs-attention` (not",
7433
+ "`status:ready`) and includes a `Missing:` line listing the",
7434
+ "field(s) that could not be determined. For example:",
7435
+ "",
7436
+ "```",
7437
+ "Missing: Tier \u2014 source document has no tier metadata and the",
7438
+ "referencing requirement is cross-tier.",
7439
+ "```",
7440
+ "",
7441
+ "A human triages the issue, fills in the missing field, and flips",
7442
+ "the label to `status:ready` before the writer picks it up."
7443
+ ];
7444
+
7345
7445
  // src/agent/bundles/requirements-analyst.ts
7346
7446
  var requirementsAnalystSubAgent = {
7347
7447
  name: "requirements-analyst",
@@ -7572,6 +7672,7 @@ var requirementsAnalystSubAgent = {
7572
7672
  " ## Proposed: <PREFIX>-<NNN> \u2014 <Title>",
7573
7673
  "",
7574
7674
  " **Category:** <FR/BR/NFR/SEC/DR/INT/OPS/UX/MT/ADR/TR>",
7675
+ " **Tier:** <platform/industry/customer-workflow/consumer-app>",
7575
7676
  " **Priority:** <High/Normal/Low>",
7576
7677
  " **Source:** <document path and section>",
7577
7678
  "",
@@ -7625,6 +7726,41 @@ var requirementsAnalystSubAgent = {
7625
7726
  "**Budget:** No web searches. Issue creation + minor edits to source",
7626
7727
  "documents.",
7627
7728
  "",
7729
+ "### `req:write` issue schema",
7730
+ "",
7731
+ "The `req:write` issues this phase creates are picked up by the",
7732
+ "downstream `requirements-writer` agent, which parses a strict",
7733
+ "schema on intake. The authoritative schema is defined in the",
7734
+ "`requirements-writer` sub-agent prompt under **The `req:write`",
7735
+ "Issue Schema** \u2014 every `req:write` issue this phase opens must",
7736
+ "conform. The same schema is embedded in the",
7737
+ "`requirements-reviewer` follow-up generator so the three",
7738
+ "producers never drift apart.",
7739
+ "",
7740
+ ...REQ_WRITE_ISSUE_SCHEMA_SECTION,
7741
+ "",
7742
+ "**Deriving the three required fields from the proposal.** For",
7743
+ "every `req:write` issue this phase opens, the three fields come",
7744
+ "directly from the Phase 2 proposal entry:",
7745
+ "",
7746
+ "- **Category** \u2014 the proposal's `**Category:**` line.",
7747
+ "- **Tier** \u2014 the proposal's `**Tier:**` line (added in Phase 2).",
7748
+ " If the proposal omitted the Tier line (older proposals may),",
7749
+ " route the issue through `Missing:` rather than guessing.",
7750
+ "- **Output Path** \u2014",
7751
+ " `<REQUIREMENTS_ROOT>/<category-dir>/<PREFIX>-<NNN>-<slug>.md`,",
7752
+ " using the sequence number determined in Phase 2 step 4.",
7753
+ "",
7754
+ "**Validation step \u2014 required before opening the issue.** Before",
7755
+ "calling `gh issue create`, verify all three required fields are",
7756
+ "populated and internally consistent (Category matches title",
7757
+ "prefix, Tier matches `tier:*` label, Output Path filename starts",
7758
+ "with the Category prefix). If any field cannot be derived, open",
7759
+ "the issue with `status:needs-attention` (not `status:ready`) and",
7760
+ "include a `Missing: <field> \u2014 <one-line reason>` line so a human",
7761
+ "triaging the issue only has to supply the remaining value(s)",
7762
+ "before flipping the label to `status:ready`.",
7763
+ "",
7628
7764
  "### Steps",
7629
7765
  "",
7630
7766
  "1. **Read the proposals** from Phase 2.",
@@ -7633,21 +7769,26 @@ var requirementsAnalystSubAgent = {
7633
7769
  "",
7634
7770
  " All `type:requirement` issues default to `priority:medium` (override",
7635
7771
  " only if the proposal's priority was explicitly High or Low). Each",
7636
- " issue must also carry the `req:write` phase label so the downstream",
7637
- " `requirements-writer` bundle picks it up.",
7772
+ " issue must also carry the `req:write` phase label plus the matching",
7773
+ " `tier:*` label so the downstream `requirements-writer` bundle picks",
7774
+ " it up with the correct tier.",
7638
7775
  "",
7639
7776
  " ```bash",
7640
7777
  " gh issue create \\",
7641
7778
  ' --title "docs(<category>): <PREFIX>-<NNN> \u2014 <title>" \\',
7642
- ' --label "type:requirement" --label "req:write" --label "status:ready" --label "priority:medium" \\',
7779
+ ' --label "type:requirement" --label "req:write" --label "tier:<tier-slug>" --label "status:ready" --label "priority:medium" \\',
7643
7780
  ' --body "## Objective',
7644
7781
  " Write <PREFIX>-<NNN> \u2014 <title>.",
7645
7782
  "",
7783
+ " **Category:** <BR/FR/NFR/TR/ADR/SEC/DR/INT/OPS/UX/MT>",
7784
+ " **Tier:** <platform/industry/customer-workflow/consumer-app>",
7785
+ " **Output Path:** <REQUIREMENTS_ROOT>/<category-dir>/<PREFIX>-<NNN>-<slug>.md",
7786
+ "",
7646
7787
  " ## Context",
7647
7788
  " - **Gap identified by:** requirements scan of <source>",
7648
7789
  " - **Proposals file:** <RESEARCH_REQUIREMENTS_ROOT>/req-proposals-<scope>-<date>.md",
7649
7790
  "",
7650
- " ## Inputs",
7791
+ " ## Inputs / Read",
7651
7792
  " - **Depends on:** (none)",
7652
7793
  " - **Read:** <RESEARCH_REQUIREMENTS_ROOT>/req-proposals-<scope>-<date>.md, <source docs>",
7653
7794
  "",
@@ -7658,12 +7799,17 @@ var requirementsAnalystSubAgent = {
7658
7799
  " - [ ] Decision authority rules followed (direct write vs. proposed)",
7659
7800
  "",
7660
7801
  " ## Scope Size",
7661
- " small",
7662
- "",
7663
- " ## Output Path",
7664
- ' <REQUIREMENTS_ROOT>/<category>/<PREFIX>-<NNN>-<slug>.md"',
7802
+ ' small"',
7665
7803
  " ```",
7666
7804
  "",
7805
+ " When one of Category / Tier / Output Path could not be derived",
7806
+ " from the proposal (for example, the proposal omitted the Tier",
7807
+ " line), replace `status:ready` with `status:needs-attention` in",
7808
+ " the label list and add a `Missing: <field> \u2014 <reason>` line",
7809
+ " directly below the Output Path line in the body. Populate",
7810
+ " whichever of the three fields **could** be derived so a human",
7811
+ " triaging the issue has the minimum possible cleanup.",
7812
+ "",
7667
7813
  "3. **Update source documents.** In each BCM model doc or competitive",
7668
7814
  " analysis that was scanned, add a note in the project-relevance /",
7669
7815
  " strategic-implications section (whichever heading the source doc uses)",
@@ -7824,61 +7970,6 @@ var requirementsAnalystBundle = {
7824
7970
  ]
7825
7971
  };
7826
7972
 
7827
- // src/agent/bundles/requirements-taxonomy.ts
7828
- var REQUIREMENTS_TAXONOMY_TABLE_SECTION = [
7829
- "## The 11-Category Taxonomy",
7830
- "",
7831
- "All requirements follow the BIZBOK-aligned 11-category taxonomy",
7832
- "below. Getting requirements into the right category matters because",
7833
- "it determines which template applies, which standards inform it, and",
7834
- "how it traces to other requirements.",
7835
- "",
7836
- "| Category | Prefix | Directory (default) | Question it answers |",
7837
- "|----------|--------|---------------------|---------------------|",
7838
- "| Business Requirements | BR | `business/` | **Why** are we building this? What business value does it deliver? |",
7839
- "| Functional Requirements | FR | `functional/` | **What** does the system do? What is the user-visible behavior? |",
7840
- "| Non-Functional Requirements | NFR | `non-functional/` | **How well** must the system perform? What quality bar must it meet? |",
7841
- "| Technical Requirements | TR | `technical/` | **What technology** are we using, and why that one? |",
7842
- "| Architectural Decisions | ADR | `architectural-decisions/` | **What structural decision** are we making, and what are the trade-offs? |",
7843
- "| Security & Compliance | SEC | `security/` | **What must we protect**, and what rules govern that protection? |",
7844
- "| Data Requirements | DR | `data/` | **What data** do we store, how long, and how do we recover it? |",
7845
- "| Integration Requirements | INT | `integration/` | **What external systems** do we connect to, and how? |",
7846
- "| Operational Requirements | OPS | `operational/` | **How do we deploy, monitor, and respond** to incidents? |",
7847
- "| UX Requirements | UX | `ux/` | **How must the interface look, feel, and behave** for users? |",
7848
- "| Multi-Tenancy & Licensing | MT | `multi-tenancy/` | **How do we isolate tenants, gate features, and meter usage?** |",
7849
- "",
7850
- "All requirement documents live under `<REQUIREMENTS_ROOT>` in the",
7851
- "category directory shown above. Directory names are defaults \u2014",
7852
- "consuming projects may rename them, but the prefixes are universal."
7853
- ];
7854
- var REQUIREMENTS_TAXONOMY_DISAMBIGUATION_SECTION = [
7855
- "- **SEC vs NFR:** Protecting data, enforcing access control, or",
7856
- " meeting a regulation \u2192 SEC. System performance, uptime, or",
7857
- ' scalability \u2192 NFR. "99.9% uptime" is NFR; "audit logs for all',
7858
- ' admin actions" is SEC.',
7859
- '- **TR vs ADR:** A TR pins down a specific technology choice ("use',
7860
- ' PostgreSQL 16+"). An ADR records a structural decision with',
7861
- ' context, trade-offs, and alternatives ("why row-level isolation',
7862
- ' over schema-per-tenant"). TRs often follow from ADRs.',
7863
- "- **FR vs INT:** What the user experiences \u2192 FR. How two systems",
7864
- ' communicate \u2192 INT. "User can pay with a credit card" is FR;',
7865
- ' "Stripe Checkout API integration for payment processing" is INT.',
7866
- "- **DR vs SEC:** What data exists, how long we keep it, and how we",
7867
- " recover it \u2192 DR. Who can access it and how it's protected \u2192 SEC.",
7868
- " These often cross-reference each other.",
7869
- "- **NFR vs OPS:** A measurable target the system must meet \u2192 NFR.",
7870
- ' The tooling and processes to run the system \u2192 OPS. "p99 latency',
7871
- ' < 200ms" is NFR; "Datadog APM for latency monitoring" is OPS.'
7872
- ];
7873
- var REQUIREMENTS_TIER_TABLE_SECTION = [
7874
- "| Tier | Slug | When to use |",
7875
- "|------|------|-------------|",
7876
- "| **Platform** | `platform` | Core platform services \u2014 APIs, tenant isolation, auth, event bus, shared infrastructure |",
7877
- "| **Industry** | `industry` | Vertical-specific capabilities not every tenant needs |",
7878
- "| **Customer Workflow** | `customer-workflow` | Business logic tenants configure within the platform \u2014 approval chains, notification rules, intake processes |",
7879
- "| **Consumer Application** | `consumer-app` | UI/UX and integrations in external front-ends/systems consuming the platform's APIs |"
7880
- ];
7881
-
7882
7973
  // src/agent/bundles/requirements-writer.ts
7883
7974
  var TEMPLATE_BR = `---
7884
7975
  title: "BR-NNN: [Business Requirement Title]"
@@ -10157,6 +10248,19 @@ var requirementsWriterSubAgent = {
10157
10248
  "",
10158
10249
  "---",
10159
10250
  "",
10251
+ "## The `req:write` Issue Schema",
10252
+ "",
10253
+ "This section is the **authoritative schema** for `req:write` issue",
10254
+ "bodies. Upstream producers (the `requirements-analyst` trace phase,",
10255
+ "the `requirements-reviewer` follow-up generator, and any human",
10256
+ "authoring a `req:write` issue directly) must embed or link to this",
10257
+ "same schema so the three required fields are always present when",
10258
+ "the writer picks the issue up.",
10259
+ "",
10260
+ ...REQ_WRITE_ISSUE_SCHEMA_SECTION,
10261
+ "",
10262
+ "---",
10263
+ "",
10160
10264
  "## The `req:write` Phase",
10161
10265
  "",
10162
10266
  "**Goal:** Read the proposal that produced this issue, write a single",
@@ -10171,14 +10275,25 @@ var requirementsWriterSubAgent = {
10171
10275
  "",
10172
10276
  "### Steps",
10173
10277
  "",
10174
- "1. **Parse the issue.** The `req:write` issue body must include:",
10175
- " - **Category** (`BR`/`FR`/`NFR`/`TR`/`ADR`/`SEC`/`DR`/`INT`/`OPS`/`UX`/`MT`)",
10176
- " - **Tier** (`platform`/`industry`/`customer-workflow`/`consumer-app`)",
10177
- " - **Output Path** under `<REQUIREMENTS_ROOT>/<category-dir>/<PREFIX>-<NNN>-<slug>.md`",
10178
- " - **Inputs / Read** \u2014 the upstream proposals file and any source",
10179
- " documents",
10180
- " If any of these are missing or contradictory, comment on the",
10181
- " issue, add `status:needs-attention`, and stop without writing.",
10278
+ "1. **Parse the issue.** The `req:write` issue body follows the",
10279
+ " authoritative schema in the",
10280
+ " [The `req:write` Issue Schema](#the-reqwrite-issue-schema)",
10281
+ " section below. Before writing, verify every required field",
10282
+ " (Category, Tier, Output Path) is present and internally",
10283
+ " consistent:",
10284
+ "",
10285
+ " - Category matches the prefix on the requirement title and on",
10286
+ " the Output Path filename.",
10287
+ " - Tier matches the `tier:*` label applied to the issue.",
10288
+ " - Output Path sits under",
10289
+ " `<REQUIREMENTS_ROOT>/<category-dir>/<PREFIX>-<NNN>-<slug>.md`.",
10290
+ "",
10291
+ " If any required field is missing, contradictory, or the issue",
10292
+ " already carries `status:needs-attention` with a `Missing:` line",
10293
+ " (upstream could not derive it), comment on the issue with",
10294
+ " which field is wrong, ensure `status:needs-attention` is set,",
10295
+ " and stop without writing. A human triages before the writer",
10296
+ " tries again.",
10182
10297
  "",
10183
10298
  "2. **Read the proposal.** Open the proposals file referenced in the",
10184
10299
  " issue inputs (under `<RESEARCH_REQUIREMENTS_ROOT>`). Find the",
@@ -10473,7 +10588,7 @@ var requirementsWriterBundle = {
10473
10588
  // src/agent/bundles/requirements-reviewer.ts
10474
10589
  var requirementsReviewerSubAgent = {
10475
10590
  name: "requirements-reviewer",
10476
- 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.",
10591
+ 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.",
10477
10592
  model: AGENT_MODEL.POWERFUL,
10478
10593
  maxTurns: 80,
10479
10594
  platforms: { cursor: { exclude: true } },
@@ -10600,6 +10715,7 @@ var requirementsReviewerSubAgent = {
10600
10715
  "| `<REVIEW_REPORTS_ROOT>` | Where review reports are written | `docs/research/reviews/` |",
10601
10716
  `| \`<TEMPLATES_ROOT>\` | Where the writer bundle ships category templates (read-only for this agent) | \`${REQUIREMENTS_WRITER_PATHS.templatesRoot}\` |`,
10602
10717
  `| \`<STANDARDS_REF>\` | Standards & frameworks reference shipped by the writer bundle | \`${REQUIREMENTS_WRITER_PATHS.standardsRef}\` |`,
10718
+ "| `<STALE_PROPOSED_THRESHOLD_DAYS>` | Age (in days) after which a `Proposed` ADR/TR is flagged as a stale decision by Check 12 | `14` |",
10603
10719
  "",
10604
10720
  "If `docs/project-context.md` specifies a different requirements",
10605
10721
  "tree, prefer that. Otherwise fall back to the defaults above.",
@@ -10649,7 +10765,7 @@ var requirementsReviewerSubAgent = {
10649
10765
  "",
10650
10766
  "## Review Checklist",
10651
10767
  "",
10652
- "Apply the following 11 checks. Each check produces zero or more",
10768
+ "Apply the following 12 checks. Each check produces zero or more",
10653
10769
  "findings. Findings are graded Critical / Warning / Info using the",
10654
10770
  "severity ladder in the next section.",
10655
10771
  "",
@@ -10894,6 +11010,60 @@ var requirementsReviewerSubAgent = {
10894
11010
  " reverse-link structure (e.g., a `referencedIn.meetings[]`",
10895
11011
  " frontmatter block) and that structure is in active use.",
10896
11012
  "",
11013
+ "### 12. Stale Proposed Decisions",
11014
+ "",
11015
+ "ADR and TR documents ship as `Status: Proposed` because they",
11016
+ "encode architectural or technology decisions that require explicit",
11017
+ "human acceptance (see Check 9 and the `requirements-writer`",
11018
+ "decision-authority rules). Once `Proposed`, there is no automatic",
11019
+ "signal that surfaces long-`Proposed` documents for decision \u2014 the",
11020
+ "backlog silently accumulates. Check 12 surfaces them.",
11021
+ "",
11022
+ "For every document under `<REQUIREMENTS_ROOT>` whose category is",
11023
+ "**ADR** or **TR** and whose `Status` is `Proposed`:",
11024
+ "",
11025
+ "- Determine the document's last-touched date. Prefer the YAML",
11026
+ " frontmatter `updated` field when present. If frontmatter does",
11027
+ " not carry an `updated` field, fall back to the most recent entry",
11028
+ " in the `## Revision History` section. If neither exists, fall",
11029
+ " back to `git log -1 --format=%cI -- <path>` for the file.",
11030
+ "- Compare that date to today. If the document has carried",
11031
+ " `Status: Proposed` for longer than",
11032
+ " `<STALE_PROPOSED_THRESHOLD_DAYS>` days (default 14), record a",
11033
+ " **Warning** finding that names the document, the age in days,",
11034
+ " the threshold, and the source used for the last-touched date.",
11035
+ "- Do **not** flag `Proposed` ADRs or TRs that are below the",
11036
+ " threshold \u2014 they are in active decision and not stale.",
11037
+ "- Do **not** auto-transition any status. Deprecation and",
11038
+ " acceptance both remain human decisions: Check 12 only surfaces",
11039
+ " the backlog for the human running `/review-requirements` (or",
11040
+ " for the follow-up issue it files) to act on.",
11041
+ "",
11042
+ "The threshold placeholder `<STALE_PROPOSED_THRESHOLD_DAYS>` is",
11043
+ "configurable \u2014 override it in the `req:review` issue body, in",
11044
+ "`docs/project-context.md`, or via `agentConfig.rules`. The default",
11045
+ "of 14 days sits above the orchestrator's existing 72h / 168h stale",
11046
+ "thresholds for `status:in-progress` / `status:blocked` and fits",
11047
+ "the pace at which architectural decisions are typically ratified.",
11048
+ "",
11049
+ "Findings from Check 12 describe a decision the human must make \u2014",
11050
+ "not an edit to the requirement document itself. Follow-up routing",
11051
+ "is therefore different from Checks 3 and 4:",
11052
+ "",
11053
+ "- Surface every stale `Proposed` ADR/TR in a distinct",
11054
+ " **Stale decisions** section in the review report (see Reporting",
11055
+ " Format below), separate from Critical / Warning / Info.",
11056
+ "- File **one** follow-up issue covering the stale decisions found",
11057
+ " in this review. Title:",
11058
+ " `req(review): decide on stale Proposed ADR/TR documents`.",
11059
+ " Labels: `type:requirement`, `req:review`, `priority:medium`,",
11060
+ " `status:needs-attention`. Body must list each stale document",
11061
+ " path, its age in days, and a link back to the review report.",
11062
+ " Do **not** file one follow-up per document \u2014 humans triage the",
11063
+ " backlog in a single pass.",
11064
+ "- When no stale documents are found, omit the Stale decisions",
11065
+ " section entirely and do not file the follow-up issue.",
11066
+ "",
10897
11067
  "---",
10898
11068
  "",
10899
11069
  "## Severity Ladder",
@@ -10929,6 +11099,13 @@ var requirementsReviewerSubAgent = {
10929
11099
  "- Missing cross-tier traceability; missing Implementor / Customer",
10930
11100
  " fields on Customer Workflow / Consumer Application requirements",
10931
11101
  " when the project tracks those fields",
11102
+ "- Stale `Proposed` ADR/TR documents that have carried the",
11103
+ " `Proposed` status longer than",
11104
+ " `<STALE_PROPOSED_THRESHOLD_DAYS>` (default 14) days. The",
11105
+ " underlying document is valid; only the absence of human",
11106
+ " decision is stale, so these are reported in the report's",
11107
+ " dedicated **Stale decisions** section rather than inline in",
11108
+ " the Warning list.",
10932
11109
  "",
10933
11110
  "### Info (Consider)",
10934
11111
  "",
@@ -10972,6 +11149,20 @@ var requirementsReviewerSubAgent = {
10972
11149
  "1. **[<file path>] <short title>** `Info`",
10973
11150
  " ...",
10974
11151
  "",
11152
+ "## Stale decisions",
11153
+ "",
11154
+ "*Omit this section entirely when Check 12 found no stale",
11155
+ "`Proposed` ADR/TR documents.*",
11156
+ "",
11157
+ "| Document | Age (days) | Threshold | Last-touched source |",
11158
+ "|----------|------------|-----------|---------------------|",
11159
+ "| `<file path>` | N | <STALE_PROPOSED_THRESHOLD_DAYS> | frontmatter `updated` / revision history / git log |",
11160
+ "",
11161
+ "Human decision required for each row. A single follow-up",
11162
+ "`req:review` issue (labels `type:requirement`, `req:review`,",
11163
+ "`priority:medium`, `status:needs-attention`) is filed to",
11164
+ "track triage; see Check 12 for the exact follow-up contract.",
11165
+ "",
10975
11166
  "## Review Summary",
10976
11167
  "",
10977
11168
  "| Severity | Count |",
@@ -10979,6 +11170,7 @@ var requirementsReviewerSubAgent = {
10979
11170
  "| Critical | N |",
10980
11171
  "| Warning | N |",
10981
11172
  "| Info | N |",
11173
+ "| Stale decisions | N |",
10982
11174
  "",
10983
11175
  "**Categories reviewed:** [list]",
10984
11176
  "**Documents reviewed:** N",
@@ -11040,7 +11232,7 @@ var requirementsReviewerSubAgent = {
11040
11232
  "1. Read scope from the `req:review` issue.",
11041
11233
  "2. Read the matching templates from `<TEMPLATES_ROOT>` for every",
11042
11234
  " category in scope.",
11043
- "3. Run the 11 checks. For audits >10 documents, write the",
11235
+ "3. Run the 12 checks. For audits >10 documents, write the",
11044
11236
  " verification script to disk first and run it.",
11045
11237
  "4. Write the report to",
11046
11238
  " `<REVIEW_REPORTS_ROOT>/review-<scope>-YYYY-MM-DD.md`.",
@@ -11070,7 +11262,9 @@ var requirementsReviewerSubAgent = {
11070
11262
  " `requirements-writer` agent picks it up to revise the",
11071
11263
  " document). Only the writer is scoped to edit requirement",
11072
11264
  " documents, so anything that requires an in-place edit under",
11073
- " `<REQUIREMENTS_ROOT>` routes here.",
11265
+ " `<REQUIREMENTS_ROOT>` routes here. `req:write` follow-ups",
11266
+ " must also carry the matching `tier:*` label and an issue",
11267
+ " body that conforms to the `req:write` issue schema below.",
11074
11268
  " - Missing traceability in **source documents** \u2014 BCM model",
11075
11269
  " docs, competitive-analysis notes, product-roadmap entries,",
11076
11270
  " meeting extracts \u2014 that should link forward to an existing",
@@ -11091,9 +11285,81 @@ var requirementsReviewerSubAgent = {
11091
11285
  "- Adds `status:ready` (or `status:blocked` when the finding",
11092
11286
  " declares a `Depends on: #N` on another open issue)",
11093
11287
  "",
11288
+ "**Check 12 exception \u2014 stale `Proposed` ADR/TR triage.** Check 12",
11289
+ "findings are the one case where follow-up flows through a new",
11290
+ "`req:review` issue rather than `req:write` / `req:trace` /",
11291
+ "`req:scan`. The finding is a decision a human must make, not an",
11292
+ "edit to a requirement document, so:",
11293
+ "",
11294
+ "- File **one** aggregated follow-up (not one per document). The",
11295
+ " title is",
11296
+ " `req(review): decide on stale Proposed ADR/TR documents`.",
11297
+ "- Labels: `type:requirement`, `req:review`, `priority:medium`,",
11298
+ " `status:needs-attention`.",
11299
+ "- Body lists every stale document surfaced in this review with",
11300
+ " its path, age in days, and the threshold used, and links back",
11301
+ " to the Stale decisions section of the review report.",
11302
+ "- This is the **only** case in which the reviewer opens a",
11303
+ " `req:review` issue \u2014 it is explicitly not self-referential",
11304
+ " because the new issue triages decisions rather than triggering",
11305
+ " another review.",
11306
+ "- The `req:write` follow-up schema below does **not** apply to",
11307
+ " this Check 12 issue; the schema governs `req:write` payloads,",
11308
+ " and this follow-up is a `req:review` triage item.",
11309
+ "",
11310
+ "### `req:write` follow-up schema",
11311
+ "",
11312
+ "Because this bundle is the second-largest producer of `req:write`",
11313
+ "issues (the analyst's trace phase is the first), every `req:write`",
11314
+ "follow-up opened in either the review phase or the deprecation",
11315
+ "phase must satisfy the schema the writer parses on intake:",
11316
+ "",
11317
+ ...REQ_WRITE_ISSUE_SCHEMA_SECTION,
11318
+ "",
11319
+ "**Deriving the three required fields from the target document.**",
11320
+ "For every structural-repair follow-up the reviewer generates, the",
11321
+ "three fields come directly from the requirement document being",
11322
+ "edited:",
11323
+ "",
11324
+ "- **Category** \u2014 read the category prefix from the document's",
11325
+ " filename (`FR-012-...` \u2192 `FR`). Confirm against the frontmatter",
11326
+ " / Metadata table `ID` row and the document's `# Heading`. If",
11327
+ " the three disagree, route through `Missing:` with the",
11328
+ " disagreement noted rather than picking one.",
11329
+ "- **Tier** \u2014 read the Metadata table `Tier` row. Normalize to the",
11330
+ " slug form (`platform`, `industry`, `customer-workflow`,",
11331
+ " `consumer-app`). If the Tier row is missing, empty, or set to",
11332
+ " a value outside the four-tier taxonomy, route through",
11333
+ " `Missing:`.",
11334
+ "- **Output Path** \u2014 the current absolute-from-repo-root path of",
11335
+ " the document being edited. The writer edits in place; the path",
11336
+ " does not change for a structural repair.",
11337
+ "",
11338
+ "For deprecation back-reference follow-ups, the three fields come",
11339
+ "from the **referencing** document (the one that still mentions",
11340
+ "the deprecated ID), not the deprecated target itself.",
11341
+ "",
11342
+ "**Validation step \u2014 required before opening the issue.** The",
11343
+ "reviewer asserts all three required fields are populated before",
11344
+ "it calls `gh issue create`. If any field cannot be derived:",
11345
+ "",
11346
+ "1. Open the follow-up with `status:needs-attention` (not",
11347
+ " `status:ready`).",
11348
+ "2. Include a `Missing: <field> \u2014 <one-line reason>` line at the",
11349
+ " top of the body explaining which field could not be",
11350
+ " determined and why (e.g., `Missing: Tier \u2014 Metadata table",
11351
+ " has no Tier row and the document predates the four-tier",
11352
+ " classification`).",
11353
+ "3. Populate whichever of the three fields **could** be derived",
11354
+ " so a human triaging the issue only has to supply the",
11355
+ " remaining value(s) before flipping the label to",
11356
+ " `status:ready`.",
11357
+ "",
11094
11358
  "**Do NOT create:**",
11095
11359
  "",
11096
- "- `req:review` issues \u2014 that would be self-referential",
11360
+ "- `req:review` issues for any reason other than the Check 12",
11361
+ " stale-decisions triage documented above \u2014 that would be",
11362
+ " self-referential",
11097
11363
  "- `bcm:*`, `people:*`, `company:*`, `software:*`, `research:*`,",
11098
11364
  " or `industry:*` issues \u2014 those belong to their respective",
11099
11365
  " bundles. If the review surfaces work for one of those bundles,",
@@ -11268,15 +11534,26 @@ var requirementsReviewerSubAgent = {
11268
11534
  " references that a single writer session can address together).",
11269
11535
  "- The issue title must be",
11270
11536
  " `req(deprecate): update references to <deprecated-ID> in <referencing-ID>`.",
11271
- "- The body must include: the referencing document path, the",
11272
- " deprecated document path, the successor path (when applicable),",
11273
- " the list of line ranges that mention the deprecated ID, the",
11274
- " `req:deprecate` issue number, and a short instruction asking the",
11275
- " writer to either remove the reference, point it at the successor,",
11276
- " or convert it to a historical note (the writer decides per",
11537
+ "- The body must conform to the `req:write` issue schema defined",
11538
+ " in the review phase's **`req:write` follow-up schema** section",
11539
+ " above: Category, Tier, and Output Path derived from the",
11540
+ " **referencing** document (not the deprecated target) via the",
11541
+ " same rules \u2014 prefix from filename, Tier from the Metadata",
11542
+ " table, Output Path is the referencing document's current path.",
11543
+ " In addition, the body must include: the deprecated document",
11544
+ " path, the successor path (when applicable), the list of line",
11545
+ " ranges that mention the deprecated ID, the `req:deprecate`",
11546
+ " issue number, and a short instruction asking the writer to",
11547
+ " either remove the reference, point it at the successor, or",
11548
+ " convert it to a historical note (the writer decides per",
11277
11549
  " reference).",
11278
- "- Labels: `type:requirement`, `req:write`, `priority:medium`,",
11279
- " `status:ready`.",
11550
+ "- Labels: `type:requirement`, `req:write`, the matching",
11551
+ " `tier:*` label derived from the referencing document's Tier,",
11552
+ " `priority:medium`, `status:ready`.",
11553
+ "- If any of Category / Tier / Output Path cannot be derived from",
11554
+ " the referencing document, open the follow-up with",
11555
+ " `status:needs-attention` and a `Missing:` line, per the same",
11556
+ " validation rule that applies in the review phase.",
11280
11557
  "- Body must include `Depends on: #<req:deprecate issue number>`",
11281
11558
  " when the rewrite should wait for the deprecation to land, or",
11282
11559
  " omit that line when the rewrite can run in parallel.",
@@ -11363,7 +11640,7 @@ var requirementsReviewerSubAgent = {
11363
11640
  };
11364
11641
  var reviewRequirementsSkill = {
11365
11642
  name: "review-requirements",
11366
- 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.",
11643
+ 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.",
11367
11644
  disableModelInvocation: true,
11368
11645
  userInvocable: true,
11369
11646
  context: "fork",
@@ -11395,9 +11672,10 @@ var reviewRequirementsSkill = {
11395
11672
  "- `category:<slug>` \u2014 audit one category directory (e.g.,",
11396
11673
  " `category:functional` audits every FR)",
11397
11674
  "- `doc:<path>` \u2014 audit one specific requirement file",
11398
- "- `check:<n>[,<n>...]` \u2014 run one or more checks (1\u201311) across the",
11675
+ "- `check:<n>[,<n>...]` \u2014 run one or more checks (1\u201312) across the",
11399
11676
  " documents in scope (e.g., `check:4` runs cross-reference",
11400
- " integrity only)",
11677
+ " integrity only, `check:12` runs the stale-proposed-decision",
11678
+ " audit only)",
11401
11679
  "",
11402
11680
  "Optional extensions in the issue body:",
11403
11681
  "",
@@ -11405,6 +11683,9 @@ var reviewRequirementsSkill = {
11405
11683
  "- `requirements-root: <path>` \u2014 override `<REQUIREMENTS_ROOT>`",
11406
11684
  "- `targets: <glob>` \u2014 restrict the document set with a glob",
11407
11685
  " pattern relative to `<REQUIREMENTS_ROOT>`",
11686
+ "- `stale-proposed-threshold-days: <n>` \u2014 override the default",
11687
+ " 14-day threshold used by Check 12 (stale `Proposed` ADR/TR",
11688
+ " decisions) for this review",
11408
11689
  "",
11409
11690
  "## Default Paths",
11410
11691
  "",
@@ -11423,10 +11704,12 @@ var reviewRequirementsSkill = {
11423
11704
  " scope, the requirements root (or accept the default), and the",
11424
11705
  " output path.",
11425
11706
  "2. Execute the review phase of the requirements-reviewer agent.",
11426
- "3. The agent runs the 11-check audit, writes a structured report",
11427
- " grouped by Critical / Warning / Info, files follow-up issues",
11428
- " for actionable findings, and comments on the `req:review`",
11429
- " issue with the summary.",
11707
+ "3. The agent runs the 12-check audit, writes a structured report",
11708
+ " grouped by Critical / Warning / Info (plus a separate",
11709
+ " **Stale decisions** section when Check 12 surfaces stale",
11710
+ " `Proposed` ADR/TR documents), files follow-up issues for",
11711
+ " actionable findings, and comments on the `req:review` issue",
11712
+ " with the summary.",
11430
11713
  "",
11431
11714
  "## Audits >10 Documents",
11432
11715
  "",
@@ -11446,6 +11729,11 @@ var reviewRequirementsSkill = {
11446
11729
  "- Follow-up GitHub issues for every Critical and Warning finding,",
11447
11730
  " carrying the appropriate phase label (`req:write`, `req:trace`,",
11448
11731
  " or `req:scan`) for the downstream agent that should act",
11732
+ "- An aggregated `req:review` follow-up issue labeled",
11733
+ " `status:needs-attention` when Check 12 surfaces stale `Proposed`",
11734
+ " ADR/TR documents (one issue per review, not one per document);",
11735
+ " the review report also includes a dedicated **Stale decisions**",
11736
+ " section in that case",
11449
11737
  "- A summary comment on the originating `req:review` issue"
11450
11738
  ].join("\n")
11451
11739
  };
@@ -11553,7 +11841,7 @@ var deprecateRequirementSkill = {
11553
11841
  };
11554
11842
  var requirementsReviewerBundle = {
11555
11843
  name: "requirements-reviewer",
11556
- 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.",
11844
+ 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.",
11557
11845
  appliesWhen: () => true,
11558
11846
  rules: [
11559
11847
  {
@@ -11578,14 +11866,26 @@ var requirementsReviewerBundle = {
11578
11866
  "Use `/review-requirements <scope>` to audit existing requirement",
11579
11867
  "documents. Four scopes are supported: `full` (every document),",
11580
11868
  "`category:<slug>` (one category directory), `doc:<path>` (one",
11581
- "specific document), and `check:<n>` (one or more of the 11",
11869
+ "specific document), and `check:<n>` (one or more of the 12",
11582
11870
  "checks across the documents in scope).",
11583
11871
  "",
11872
+ "Check 12 flags ADR and TR documents that have carried",
11873
+ "`Status: Proposed` longer than",
11874
+ "`<STALE_PROPOSED_THRESHOLD_DAYS>` days (default 14, configurable",
11875
+ "via the `req:review` issue body, `docs/project-context.md`, or",
11876
+ "`agentConfig.rules`). Stale decisions are reported in a separate",
11877
+ "**Stale decisions** section of the review report and trigger one",
11878
+ "aggregated `req:review` follow-up issue labeled",
11879
+ "`status:needs-attention` so a human can triage the backlog. The",
11880
+ "reviewer never auto-transitions status \u2014 acceptance and",
11881
+ "deprecation both remain human decisions.",
11882
+ "",
11584
11883
  "The review phase produces **review reports and follow-up issues",
11585
11884
  "only** \u2014 it never edits requirement documents, capability",
11586
11885
  "models, or research notes. It files follow-up issues with the",
11587
- "appropriate phase label (`req:write`, `req:trace`, or",
11588
- "`req:scan`) for the downstream agent to pick up.",
11886
+ "appropriate phase label (`req:write`, `req:trace`, `req:scan`,",
11887
+ "or \u2014 only for Check 12 stale-decision triage \u2014 `req:review`)",
11888
+ "for the downstream agent or human to pick up.",
11589
11889
  "",
11590
11890
  "For audits covering more than 10 documents, the reviewer writes",
11591
11891
  "a read-only Python verification script alongside the report and",