Skip to content

docs(adr-author): update stale ms.date in lineage-rules.md - #3277

Merged
Chris Montazer (rezatnoMsirhC) merged 5 commits into
microsoft:mainfrom
Anshuman-Prakash:docs/stale-2584
Oct 27, 2026
Merged

Chris Montazer (rezatnoMsirhC) merged 5 commits into
microsoft:mainfrom
Anshuman-Prakash:docs/stale-2584

Conversation

@Anshuman-Prakash

Copy link
Copy Markdown
Contributor

Pull Request

Description

Updates the ms.date frontmatter in .github/skills/project-planning/adr-author/references/lineage-rules.md from 2026-05-02 to 2026-10-21, clearing the 170-day staleness flag.

Before refreshing the date I checked each of the five documented GP-06 rules against the adr-author scripts in this checkout, and all five still hold:

  • Rule 1 (field shape) — validate_frontmatter.py:281-282 calls _validate_id_scalar on both supersedes and superseded-by, so each must be an NNNN string or null and array values are rejected.
  • Rule 2 (single-parent supersession) — update_lineage.py:183-185 reads the predecessor's existing superseded-by and raises GP-06 single-parent violation: ADR <id> already superseded by '<parent>' on a second attempt.
  • Rule 3 (status transition) — update_lineage.py:189 sets the superseded ADR's status to superseded; the successor's accepted/proposed status is still owned by the Govern phase as the page describes.
  • Rule 4 (atomic update) — supersede() stages both ADR files through tempfile.mkstemp + os.replace and unlinks both temporaries on failure (update_lineage.py:194-214), so the pair is written or neither is.
  • Rule 5 (single writer for last_decision_id) — update_lineage.py is the only script under adr-author/scripts/ that references last_decision_id, and it writes .adr-config.yml through _atomic_write (line 148).

Both scripts the page names (scripts/validate_frontmatter.py, scripts/update_lineage.py) still exist at those paths.

One observation I did not act on, in case a maintainer wants to: the five LINEAGE_* identifiers in the "Validation Failure Modes" section read like literal error codes, but those exact strings do not appear anywhere in the skill's scripts — the equivalent runtime messages are phrased differently (for example GP-06 single-parent violation: ...). The failure categories are accurate; only the code-like spelling is unsourced. I left the section unchanged rather than guess at the intended contract.

No technical content needed changing, so this PR is limited to the date metadata.

Related Issue(s)

Fixes #2584

Type of Change

Code & Documentation:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Infrastructure & Configuration:

  • GitHub Actions workflow
  • Linting configuration (markdown, PowerShell, etc.)
  • Security configuration
  • DevContainer configuration
  • Dependency update

AI Artifacts:

  • Reviewed contribution with hve-builder and addressed all actionable findings
  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot prompt (.github/prompts/*.prompt.md)
  • Copilot agent (.github/agents/*.agent.md)
  • Copilot skill (.github/skills/*/SKILL.md)
  • Copilot hook (.github/hooks/*/*.json)
  • Eval spec added/updated for changed AI artifacts (evals/)

Other:

  • Script/automation (.ps1, .sh, .py)
  • Other (please describe):

Testing

Reviewed the diff and confirmed the only change is the ms.date value; the page body and the rest of the frontmatter are untouched, and the file's CRLF line endings are preserved. The rule checks listed above were done by reading the referenced scripts in this checkout. The repository's PowerShell validators (npm run lint:frontmatter, npm run lint:adr-consistency) need pwsh, which is not available on this machine, so they were left to CI.

Checklist

Required Checks

  • Documentation is updated (if applicable)
  • Files follow existing naming conventions
  • Changes are backwards compatible (if applicable)
  • Tests added for new functionality (if applicable)

Security Considerations

  • This PR does not contain any sensitive or NDA information
  • Any new dependencies have been reviewed for security issues
  • Security-related scripts follow the principle of least privilege

Additional Notes

This change does not claim the page's guidance was re-validated beyond the specific rule checks listed above.

🤖 Generated with Claude Code

Refresh the ms.date frontmatter from 2026-05-02 to 2026-10-21 after
verifying the five GP-06 lineage rules against the adr-author
validators.

Fixes microsoft#2584

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.24%. Comparing base (e950dbd) to head (22dad33).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3277      +/-   ##
==========================================
- Coverage   85.24%   85.24%   -0.01%     
==========================================
  Files         198      198              
  Lines       40622    40622              
  Branches      201      201              
==========================================
- Hits        34630    34629       -1     
- Misses       5921     5922       +1     
  Partials       71       71              
Flag Coverage Δ
pester 86.85% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…d codes

Address review feedback on microsoft#3277. The page claimed all five GP-06 rules
were enforced by the two scripts and listed five LINEAGE_* error codes;
neither holds. Verified against the scripts and corrected:

- Replaced the five LINEAGE_* codes with the messages the scripts
  really emit and their exit codes. No LINEAGE_* string exists anywhere
  in the adr-author skill. Rule 3 now has no failure mode listed,
  because nothing detects a violation of it.
- Added an explicit enforcement line to each rule, marking it tooling,
  convention, or mixed, and noted the two structural limits up front:
  validate_frontmatter.py validates one supplied file at a time and
  never reads .adr-config.yml or the ADR directory, and
  update_lineage.py only checks supersessions that go through it.
- Rule 3: the script sets the predecessor's status to superseded but
  never touches the successor's, and nothing compares the pair, so
  "the validator rejects any other final-state combination" was wrong.
- Rule 4: supersede() is a best-effort rollback (tempfile + os.replace,
  restoring the successor if the predecessor's move fails), not a
  transaction, and nothing inspects a commit or staged change set. Also
  noted that the post-write validate_lineage() hook is a no-op that
  tests patch.
- Rule 5: validate_frontmatter.py never references last_decision_id or
  .adr-config.yml, so the described drift check does not exist. The
  single-writer half holds and is now marked a convention.
- Rule 2 counter-example used `ADR-0042` as a field value; these fields
  hold bare four-digit strings, so it now reads `"0042"`.

Tables formatted with markdown-table-formatter 1.7.0 (the version
package.json pins), so `lint:tables` reports no changes needed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Anshuman-Prakash

Copy link
Copy Markdown
Contributor Author

Thanks Chris Montazer (@rezatnoMsirhC) — this was the right call, and all three comments check out. Rewritten in 5f1b4a6 rather than just refreshing the date.

You identified the root cause better than my PR description did: the page's opening line claimed "All five are enforced by scripts/validate_frontmatter.py and scripts/update_lineage.py", and almost everything overstated downstream of that. Two structural limits make several of the claims impossible, so I put them up front:

  • validate_frontmatter.py takes ADR paths on the command line (paths, nargs="+") and runs validate_file() on each one independently. It never scans the ADR directory, never reads .adr-config.yml, and never compares two ADRs — so it cannot enforce any cross-file rule.
  • update_lineage.py only applies its checks when a supersession goes through the script; hand-edited frontmatter is never re-examined.

Rule 3 — confirmed overstated. supersede() sets old_fm["status"] = "superseded" on the predecessor and never reads or writes the successor's status. validate_frontmatter.py only checks status not in STATUS_ENUM for a single file. Nothing compares the pair, so the rejected successor counter-example is not rejected by tooling. I used your suggested wording and marked the rule mixed — predecessor status written by the script, successor status a review concern.

Rule 5 — confirmed. grep for last_decision_id and adr-config in validate_frontmatter.py returns nothing at all, so the drift check does not exist. The single-writer half holds (allocate bumps the value and _atomic_writes .adr-config.yml), so that's now marked convention with the drift claim removed.

Validation Failure Modes — confirmed. No LINEAGE_* string appears anywhere in the adr-author skill outside this one page. I took your "list the actual messages and exit codes" option and replaced the five invented codes with a table of the real ones:

Rule Message Exit
1 <path>: superseded-by: must be a single NNNN string (GP-06 single-parent), not a list 1
2 update_lineage: GP-06 single-parent violation: ADR 0007 already superseded by '0042' 2
4 update_lineage: superseded ADR not found: <path> / I/O error: <detail> 1
5 update_lineage: last_decision_id: must be int or NNNN string / exhausted (>= 9999) 1

Rule 3 now has no entry, which makes the gap you found visible instead of papered over. Exit codes come from main(): PermissionError → EXIT_ERROR (2), ValueError/FileNotFoundError/RuntimeError/OSError → EXIT_FAILURE (1).

Rule 4 — confirmed, and more precisely than I'd put it. supersede() writes both candidates via tempfile.mkstemp then os.replace, and if the predecessor's replace throws it rewrites the successor from new_text_before. That's a compensating rewrite, so I now say an interruption between the two os.replace calls can still leave the pair half-applied — "Partial writes are rolled back" implied more than the code delivers. Nothing inspects a commit or change set, so the line 45 counter-example is a review concern. I also documented that validate_lineage() is a no-op that tests patch, since that's surprising to a reader.

Smaller point taken too — Rule 2's counter-example used ADR-0042 as a field value; ID_RE is ^\d{4}$, so it now reads "0042" / "0099".

Every rule now carries an explicit Enforcement: line marking it tooling, convention, or mixed, which I think is the durable fix here — it stops the page drifting back into claiming enforcement that was never implemented.

One CI note: the new table meant lint:tables mattered. pwsh isn't available on my machine, so I ran the same formatter the wrapper invokes (markdown-table-formatter 1.7.0, the version package.json pins) directly through node, in -Check mode first — it reported needs-format, so I formatted and re-checked until it reported clean. CRLF endings preserved. lint:frontmatter and lint:adr-consistency still need pwsh, so those are on CI.

ms.date is 2026-10-23, and I updated the frontmatter description, which also claimed all five rules were validator-enforced.

Merged via the queue into microsoft:main with commit eae87ec Oct 27, 2026
152 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Update stale documentation - .github/skills/project-planning/adr-author/references/lineage-rules.md

5 participants