Skip to content

feat: ADR Agent Phase 2 — CLI Commands Week 3-4 (Accept, Supersede, Link) - #2064

Closed
ashleyshaw wants to merge 3 commits into
developfrom
feat/adr-phase-2-cli-commands-clean
Closed

feat: ADR Agent Phase 2 — CLI Commands Week 3-4 (Accept, Supersede, Link)#2064
ashleyshaw wants to merge 3 commits into
developfrom
feat/adr-phase-2-cli-commands-clean

Conversation

@ashleyshaw

Copy link
Copy Markdown
Member

Summary

Implement three remaining CLI commands for ADR Agent Phase 2 Week 3-4:

  • Accept Command: Transition ADR from Proposed → Accepted
  • Supersede Command: Mark ADR as superseded with cross-reference updates
  • Link Command: Create relationships between ADRs

All commands include comprehensive error handling, input validation, and 40+ test cases.

Changes

New CLI Commands (292 LOC)

accept.js (67 LOC)

  • Validates ADR status is "Proposed"
  • Updates to "Accepted" with acceptance_date
  • Safe YAML parsing and error handling

supersede.js (118 LOC)

  • Updates old ADR: status→Superseded, adds superseded_by and date
  • Updates new ADR: adds old ADR to supersedes array
  • Circular reference detection
  • Maintains existing references

link.js (107 LOC)

  • Adds target ADR to source's relates_to array
  • Duplicate link prevention
  • Self-link prevention
  • Maintains existing relationships

Test Suite (415 LOC)

cli-commands.test.js

  • 40+ test cases
  • Accept: 6 tests | Supersede: 10 tests | Link: 11 tests
  • Exit code validation: 9 tests
  • Edge cases: 4+ tests

Exit Codes

  • 0: Success
  • 1: Execution/validation error
  • 2: Unexpected error
  • 4: Input validation error (missing/invalid args)

Quality Features

✅ Safe YAML parsing (yaml.safeLoad)
✅ Input validation
✅ File existence validation
✅ YAML parsing error handling
✅ State transition validation
✅ Reference integrity checks
✅ User-friendly error messages

Related Issues

Next Steps

  • CLI router integration
  • npm scripts setup (adr:accept, adr:supersede, adr:link)
  • GitHub Actions workflows (Phase 2 Week 5-6)
  • Cross-repo features (Phase 2 Week 7-8)

🤖 Generated with Claude Code

Test Userand others added 3 commits August 18, 2026 22:34
RELEASE_PROCESS.md (v3.0.1 → v3.1):
- Added comprehensive Phase 5A Safety Gates Layer section
- Included Mermaid flowchart showing 7-gate orchestration with fail paths
- Documented all 7 gates with purposes and failure conditions
- Added Phase 5A to Phase 4 integration architecture
- Updated last_updated from 2026-08-08 to 2026-08-18
- Added references to PR #2016 and agentic-workflows project
VERSIONING.md:
- Added YAML frontmatter with metadata (version, last_updated, tags)
- Added Phase 5A version validation gate documentation (GATE 3)
- Included Mermaid diagram: Version validation flow (semver checks, bump validation)
- Documented what GATE 3 validates with detailed scenarios
- Added examples of passing and failing version bumps
CHANGELOG_AUTOMATION.md (v1.0.1 → v1.1):
- Added Phase 5A changelog validation gate documentation (GATE 1)
- Included Mermaid flowchart: Changelog validation pipeline
- Documented GATE 1 validation checks
- Explained why GATE 1 is critical for release quality
- Updated last_updated from 2026-07-30 to 2026-08-18
release.agent.md (v2.5 → v2.6):
- Updated last_updated to 2026-08-18
- Added comprehensive Phase 5A Safety Gates section
- Documented all 7 gates architecture and workflow
- Included implementation details and audit logging
- Added soft launch timeline and project references
Relates to: Issue #2056 (Phase 5A Release Documentation — Comprehensive Audit & Updates)
Soft launch: Sep 9, 2026 | Team training: Sep 6, 2026
…ink)
Implement three remaining CLI commands for ADR lifecycle management:
**Accept Command** (accept.js, 67 LOC)
- Transition ADR from Proposed → Accepted status
- Validate current status before accepting
- Add acceptance_date field (ISO format)
- Exit codes: 0 (success), 1 (error), 4 (input validation)
**Supersede Command** (supersede.js, 118 LOC)
- Mark ADR as superseded by another ADR
- Update both old and new ADR files
- Prevent circular references
- Prevent self-supersedence
- Maintain existing supersedes references
**Link Command** (link.js, 107 LOC)
- Create relationship links between ADRs
- Add target ADR to source's relates_to array
- Prevent duplicate links
- Prevent self-linking
- Maintain existing relationships
**Comprehensive Test Suite** (cli-commands.test.js, 415 LOC)
- 40+ test cases covering all commands
- Happy path testing (6 tests for accept, 10 for supersede, 11 for link)
- Error handling and edge cases
- Exit code validation (9 tests)
- YAML parsing and file I/O validation
**Quality Assurance:**
- ✅ Safe YAML parsing (yaml.safeLoad)
- ✅ Proper error handling with exit codes (0, 1, 2, 4)
- ✅ All edge cases handled
- ✅ Input validation (return 4 for invalid)
- ✅ File existence validation
- ✅ Reference integrity checks
- ✅ User-friendly error messages
**Total Implementation:** 292 lines production code + 415 test code
**Phase 2 Week 3-4 Success Criteria Met:**
- ✅ 3 CLI commands fully functional
- ✅ 40+ tests passing
- ✅ All Phase 1 tests still pass (88+)
- ✅ Exit codes correct (0, 1, 2, 4)
- ✅ Error messages helpful
- ✅ Ready for GitHub Actions phase (Week 5-6)
Closes#1832 (Phase 2 CLI Implementation)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@coderabbitai

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@ashleyshaw, you've reached your PR review limit, so we couldn't start this review.

Next review available in:44 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 6cc6957e-f69a-4877-8bd0-6f818d2ebe41

📥 Commits

Reviewing files that changed from the base of the PR and between 5a9448b and ddab1f0.

📒 Files selected for processing (7)
  • agents/adr-generator/cli-commands/accept.js
  • agents/adr-generator/cli-commands/link.js
  • agents/adr-generator/cli-commands/supersede.js
  • agents/adr-generator/tests/cli-commands.test.js
  • docs/CHANGELOG_AUTOMATION.md
  • docs/RELEASE_PROCESS.md
  • docs/VERSIONING.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

🚫 This PR description is missing required template content.

Missing required section(s): Linked issues, Changelog, Global DoD checklist

Please update the PR body using one of the repository PR templates:

Empty placeholders, unchecked checklist boxes, and stub issue references do not count.

@github-actions

Copy link
Copy Markdown
Contributor

❌ Branch Name Validation Failed

The branch name feat/adr-phase-2-cli-commands-clean does not follow the LightSpeed branching strategy.

Required Format

{type}/{scope}-{short-title}
  • type: one of the allowed prefixes (lowercase)
  • scope: lowercase, hyphens only (no underscores or uppercase)
  • title: lowercase, hyphens only (no underscores or uppercase)

Allowed Branch Types

feat, fix, hotfix, release, refactor, chore, docs, test, perf, ci, build, deps, security, revert, research, design, a11y, ux, i18n, ops, proto, ds, api, schema, telemetry, content, seo, config, migrate, qa, uat, audit, codex

Valid Examples

  • feat/branch-naming-enforcement
  • fix/validation-script-bug
  • chore/update-dependencies
  • docs/branching-strategy-guide
  • hotfix/critical-security-patch

Invalid Examples

  • claude/my-branch (type "claude" not allowed)
  • Feature/MyBranch (uppercase not allowed)
  • fix-bug (missing type prefix)
  • feat/my_feature (underscores not allowed)
  • feat/MyFeature (uppercase not allowed)

Solution

Rename your branch to follow the pattern and update the PR.

For more information, see docs/BRANCHING_STRATEGY.md.

@ashleyshaw
ashleyshaw deleted the feat/adr-phase-2-cli-commands-clean branch August 18, 2026 22:27
Sign up for freeto 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.

1 participant

@ashleyshaw