docs: reconstruct ADR event stream and add workflow tools #213

Merged
jwilger merged 4 commits from docs/reconstruct-adr-event-log into main 2026-05-16 13:33:56 -07:00
Owner

Summary

  • Reconstruct the ADR set as point-in-time decision records and add docs/ARCHITECTURE.md as the current projection.
  • Add typed opencode ADR workflow tools and guard direct edits to ADR/projection files.
  • Add release-tooling coverage plus reviewer/contributor guardrails for ADR immutability and projection updates.

Verification

  • bash tests/release_tooling_test.sh
  • rtk git diff --check
  • architecture-reviewer: no blocking findings
## Summary - Reconstruct the ADR set as point-in-time decision records and add docs/ARCHITECTURE.md as the current projection. - Add typed opencode ADR workflow tools and guard direct edits to ADR/projection files. - Add release-tooling coverage plus reviewer/contributor guardrails for ADR immutability and projection updates. ## Verification - bash tests/release_tooling_test.sh - rtk git diff --check - architecture-reviewer: no blocking findings
Split the mutable ADR set into point-in-time decisions and add ARCHITECTURE.md as the current projection.
Manage ADR and architecture projection changes through typed opencode tools so accepted decisions stay immutable and projection updates happen on acceptance.
chore: merge main into ADR branch
All checks were successful
CI / Verify PR with nix flake check (pull_request) Successful in 3m32s
CI / Build PR artifacts (no token) (pull_request) Successful in 2s
CI / Request auto_review semantic review (pull_request) Successful in 1s
CI / Publish PR artifact packages (pull_request) Successful in 2s
auto_review auto_review: 1 warning
153a2106ba
Resolve opencode discipline plugin updates from main with the ADR workflow guardrails before opening the PR.
auto-review requested changes 2026-05-16 12:46:59 -07:00
Dismissed
auto-review left a comment

This PR introduces a comprehensive ADR workflow, reconstructs ADRs as point-in-time decision records, and adds tools to manage ADR workflows. The changes appear well-structured and safe to merge, with some recommendations for additional error handling and validation.

Walkthrough

  • .forgejo/pull_request_template.md: Adds a checklist item for ADR workflow compliance, ensuring contributors follow the new process.
  • .opencode/agents/architecture-reviewer.md: Updates responsibilities to include docs/ARCHITECTURE.md, emphasizing the importance of ADR and architecture projection.
  • .opencode/plugins/auto-review-discipline.ts: Introduces several functions for managing ADRs, including creation, updating, and acceptance. Suggestions include adding error handling for file operations and ensuring directory existence.

Pre-merge checks

  • PR metadata quality: failed
  • Rationale: The title does not use an imperative verb or a conventional commit prefix. It should start with a verb like 'Reconstruct' or follow a conventional commit format.
  • Offending text: Reconstruct ADR event stream and add ADR workflow tools
This PR introduces a comprehensive ADR workflow, reconstructs ADRs as point-in-time decision records, and adds tools to manage ADR workflows. The changes appear well-structured and safe to merge, with some recommendations for additional error handling and validation. ## Walkthrough - **.forgejo/pull_request_template.md**: Adds a checklist item for ADR workflow compliance, ensuring contributors follow the new process. - **.opencode/agents/architecture-reviewer.md**: Updates responsibilities to include `docs/ARCHITECTURE.md`, emphasizing the importance of ADR and architecture projection. - **.opencode/plugins/auto-review-discipline.ts**: Introduces several functions for managing ADRs, including creation, updating, and acceptance. Suggestions include adding error handling for file operations and ensuring directory existence. ## Pre-merge checks - PR metadata quality: failed - Rationale: The title does not use an imperative verb or a conventional commit prefix. It should start with a verb like 'Reconstruct' or follow a conventional commit format. - Offending text: Reconstruct ADR event stream and add ADR workflow tools
@ -32,0 +101,4 @@
function replaceProposedArchitecturePatchSection(text, patch) {
const section = proposedArchitecturePatchSection(patch).trimEnd();
if (!/^## Proposed Architecture Patch\n\n/m.test(text)) return `${text.trimEnd()}\n\n${section}\n`;
return text.replace(/(^|\n)## Proposed Architecture Patch\n\n[\s\S]*?(?=\n## |\s*$)/, `$1${section}`);
Owner

🟡 Warning: Lines 104–264: The adr_create tool's supersedes handling assumes all entries are valid. Consider adding validation to ensure each entry references an existing ADR file.

🟡 **Warning:** **Lines 104–264:** The `adr_create` tool's `supersedes` handling assumes all entries are valid. Consider adding validation to ensure each entry references an existing ADR file.
jwilger marked this conversation as resolved
jwilger changed title from Reconstruct ADR event stream and add ADR workflow tools to docs: reconstruct ADR event stream and add workflow tools 2026-05-16 13:19:28 -07:00
jwilger left a comment

Addressed actionable inline feedback.

Addressed actionable inline feedback.
@ -32,0 +91,4 @@
if (!patch || typeof patch !== "object") throw new Error("adr_create requires architecturePatch");
const patchRecord = patch;
const storedPatch = {
path: requireString(patchRecord, "path"),
Author
Owner

@auto-review Addressed. Reflection: I relied on the later status read to validate superseded ADRs, which let a raw filesystem ENOENT escape instead of validating the tool contract first. Classification: one-off; the existing ADR tool coverage is the right guardrail, but it was missing this negative case. I added focused coverage for a missing supersedes ADR path and now requireAcceptedSupersedes rejects non-ADR or absent paths with supersedes entries must reference existing ADR files.

@auto-review Addressed. Reflection: I relied on the later status read to validate superseded ADRs, which let a raw filesystem ENOENT escape instead of validating the tool contract first. Classification: one-off; the existing ADR tool coverage is the right guardrail, but it was missing this negative case. I added focused coverage for a missing supersedes ADR path and now `requireAcceptedSupersedes` rejects non-ADR or absent paths with `supersedes entries must reference existing ADR files`.
jwilger marked this conversation as resolved
fix(opencode): validate ADR supersedes paths
All checks were successful
CI / Verify PR with nix flake check (pull_request) Successful in 3m33s
CI / Request auto_review semantic review (pull_request) Successful in 2s
CI / Build PR artifacts (no token) (pull_request) Successful in 3s
CI / Publish PR artifact packages (pull_request) Successful in 2s
auto_review auto_review: no findings
db5df23584
auto-review left a comment

The PR introduces validation for ADR supersedes entries to ensure they reference existing ADR files, along with corresponding test coverage. The changes appear safe to merge.

Walkthrough

Δ since 153a210:

  • Validation Enhancement: Added a check in requireAcceptedSupersedes to ensure supersedes entries reference existing ADR files.
  • Test Coverage: Introduced a test case in opencode_adr_create_behavior_test.mjs to verify the new validation logic for missing ADR files in supersedes entries.
The PR introduces validation for ADR supersedes entries to ensure they reference existing ADR files, along with corresponding test coverage. The changes appear safe to merge. ## Walkthrough ### Δ since 153a210: - **Validation Enhancement**: Added a check in `requireAcceptedSupersedes` to ensure supersedes entries reference existing ADR files. - **Test Coverage**: Introduced a test case in `opencode_adr_create_behavior_test.mjs` to verify the new validation logic for missing ADR files in supersedes entries.
jwilger deleted branch docs/reconstruct-adr-event-log 2026-05-16 13:33:56 -07:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Slipstream/auto_review!213
No description provided.