Skip to content

docs(#37): back-fill AgDR-0001 for web↔api communication decision#38

Merged
G0maa merged 2 commits into
mainfrom
docs/GH-11-agdr-web-api-communication
May 27, 2026
Merged

docs(#37): back-fill AgDR-0001 for web↔api communication decision#38
G0maa merged 2 commits into
mainfrom
docs/GH-11-agdr-web-api-communication

Conversation

@G0maa

@G0maa G0maa commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Back-fills the first Agent Decision Record for marsa (docs/agdr/AgDR-0001-web-api-communication.md), recording the REST + OpenAPI + generated-types/Zod decision that was implemented in feat: typed REST communication layer between web and api (#11) #33 but never captured in the canonical AgDR location.
  • Condenses the existing design spec (docs/superpowers/specs/2026-05-26-web-api-communication-design.md) into the standard AgDR shape — context, options considered (tRPC / GraphQL / types-only / full SDK, each with why-rejected), decision, consequences, and artifact links.
  • Makes the decision portfolio-discoverable/agdr search walks every managed project's docs/agdr/, so future "have we decided this before?" lookups surface it instead of silently re-litigating REST-vs-tRPC.

Docs-only change — no code, no behaviour change. Closes the AgDR gap flagged during a retro code review of #33.

Testing

  1. Render docs/agdr/AgDR-0001-web-api-communication.md on GitHub and confirm the AgDR template sections are present (Context, Options Considered, Decision, Consequences, Artifacts).
  2. Confirm the artifact links resolve (feat: typed REST communication layer between web and api (#11) #33, Decide on a communication method between WEB/API #11, the spec/plan paths).

Closes #37
Refs #11, #33

Glossary

Term Definition
AgDR Agent Decision Record — a lightweight ADR variant capturing context, options, decision, and consequences for a choice made during agent-assisted development. Stored per-project under docs/agdr/.
OpenAPI A language-agnostic specification format (formerly Swagger) describing a REST API's endpoints and schemas. Here, generated from NestJS decorators and committed as the source of truth.
Zod A TypeScript-first schema declaration + runtime validation library. Generated Zod schemas validate API responses at the web boundary so contract drift throws instead of propagating as mistyped data.
Contract drift Divergence between the committed API contract and what the server actually returns; a CI step regenerates both artifacts and fails on drift.
tRPC A TypeScript-only RPC framework giving end-to-end type inference without codegen — rejected here because it forecloses a non-TS public API.

Summary by CodeRabbit

  • Documentation
    • Added an architecture decision record defining the standard REST-over-HTTP web↔API approach with a committed OpenAPI contract as the single source of truth, automated generation of TypeScript types and validation schemas for the web client, a prescribed generation/consumption workflow, CI drift-checks that fail builds on contract changes, and documented alternatives considered.

Review Change Stack

- Records the REST + OpenAPI + generated types/Zod decision in the
  canonical docs/agdr/ location (first AgDR for marsa)
- Condenses the design spec from PR #33 into the AgDR template:
  context, options considered (tRPC/GraphQL/types-only/SDK), decision,
  consequences, artifacts
- Makes the decision discoverable via the portfolio /agdr search

Refs #11
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 904e3caf-1ca5-4c95-b829-0324d85a3176

📥 Commits

Reviewing files that changed from the base of the PR and between 3556890 and efd4c9f.

📒 Files selected for processing (1)
  • docs/agdr/AgDR-0001-web-api-communication.md
✅ Files skipped from review due to trivial changes (1)
  • docs/agdr/AgDR-0001-web-api-communication.md

📝 Walkthrough

Walkthrough

Added AgDR-0001 documenting the selected REST + committed OpenAPI + generated TypeScript/Zod communication strategy between web and API, including codegen wiring, CI drift-check policy, deferred alternatives, and artifact references.

Changes

Web↔API Communication AgDR

Layer / File(s) Summary
AgDR-0001: Web↔API Communication Decision
docs/agdr/AgDR-0001-web-api-communication.md
New Architectural Decision Record capturing REST over HTTP with a committed OpenAPI as single source of truth, generated TypeScript types and Zod schemas, concrete wiring (NestJS Swagger → apps/api/openapi.json; @hey-api/openapi-tstypes.gen.ts & zod.gen.ts; Nuxt plugin exposing $api; composables validating via generated Zod), CI drift-check/regeneration policy, deferred alternatives (tRPC, GraphQL, types-only, full SDK), and references to implementation/planning artifacts.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit hops to log the choice,
REST and OpenAPI get my voice.
Types and Zod, generated true,
CI guards drift, the path in view.
🐇📜

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(#37): back-fill AgDR-0001 for web↔api communication decision' clearly summarizes the main change: adding the first AgDR document for the web-API communication decision, directly addressing issue #37.
Linked Issues check ✅ Passed The pull request fully implements all coding and documentation requirements from issue #37: creates docs/agdr/AgDR-0001-web-api-communication.md with all five required template sections, condenses the design spec, and ensures artifact links resolve.
Out of Scope Changes check ✅ Passed All changes are strictly documentation-only and directly scoped to issue #37 requirements. No code, configuration, or unrelated documentation changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/GH-11-agdr-web-api-communication

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

@G0maa G0maa left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR #38

Commit: 3556890f0851250e9cfe8f3bd9c7feedf84eae36

Summary

Docs-only PR back-filling the project's first Agent Decision Record (AgDR-0001), recording the web↔api communication decision (REST + committed OpenAPI + generated TypeScript types/Zod, consumed Nuxt-natively) that was already implemented in merged PR #33. Single file: docs/agdr/AgDR-0001-web-api-communication.md. Closes #37, refs #11 + #33.

Checklist Results

  • Architecture & Design: N/A (docs-only, no code)
  • Code Quality: N/A (docs-only, no code)
  • Testing: N/A (docs-only — no testable code; coverage gate does not apply)
  • Security: Pass (no secrets, no sensitive content)
  • Performance: N/A (docs-only)
  • PR Description & Glossary: Pass — 5-term Glossary present (AgDR, OpenAPI, Zod, Contract drift, tRPC)
  • Summary Bullet Narrative: Pass — all three bullets state what changed + why it matters
  • Technical Decisions (AgDR):N/A — this PR is the AgDR; AgDR-creation gate does not require a meta-AgDR
  • Adopter Handbooks: N/A — no handbooks loaded (diff matches no language/architecture buckets)

Issues Found

None.

Verification performed

  • Template fidelity: AgDR follows the canonical template — Context, Options Considered, Decision, Consequences, Artifacts all present, plus a well-formed one-line decision summary in the "In the context of… I decided… accepting…" shape.
  • Artifact links accurate: confirmed every referenced path exists on the branch — design spec, implementation plan, generate-open-api.ts, openapi-ts.config.ts, plugins/api.ts, composables/useApiStatus.ts, .github/workflows/ci.yml, and the committed apps/api/openapi.json.
  • Faithful to #33: the documented decision matches what #33 implemented — verified the CI drift gate exists in ci.yml (regenerates both artifacts, fails on git diff --exit-code), and the SDK-plugin-disabled / types+zod approach is reflected in the config files.
  • Options coverage: tRPC, GraphQL, types-only, and full-SDK alternatives each documented with concrete why-rejected rationale — strong decision record.
  • Ticket linkage: Closes #37 is OPEN and titled "[Docs] Back-fill AgDR-0001…", matching this PR.

Suggestions

None blocking. Nicely scoped, accurate, portfolio-discoverable.

Verdict

APPROVED


🤖 Reviewed by Rex (Code Reviewer Agent)
📌 Reviewed commit: 3556890f0851250e9cfe8f3bd9c7feedf84eae36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/agdr/AgDR-0001-web-api-communication.md (1)

1-46: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix Prettier formatting issues to unblock CI.

The pipeline reports code style violations. Run prettier --write on this file to resolve them before merge.

#!/bin/bash
# Fix formatting issues
pnpm prettier --write docs/agdr/AgDR-0001-web-api-communication.md
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/agdr/AgDR-0001-web-api-communication.md` around lines 1 - 46, The AgDR
markdown ("Web ↔ API Communication: REST + OpenAPI with generated types + Zod")
has Prettier style violations; fix by running the repository Prettier formatter
(pnpm prettier --write) on the affected document, stage and commit the
reformatted file, and push the commit so CI can re-run the lint/format check;
ensure the commit only contains formatting changes for the AgDR file.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/agdr/AgDR-0001-web-api-communication.md`:
- Around line 1-46: The AgDR markdown ("Web ↔ API Communication: REST + OpenAPI
with generated types + Zod") has Prettier style violations; fix by running the
repository Prettier formatter (pnpm prettier --write) on the affected document,
stage and commit the reformatted file, and push the commit so CI can re-run the
lint/format check; ensure the commit only contains formatting changes for the
AgDR file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a862d6a-6822-4c17-9b9f-208ec0800a2e

📥 Commits

Reviewing files that changed from the base of the PR and between cea941f and 3556890.

📒 Files selected for processing (1)
  • docs/agdr/AgDR-0001-web-api-communication.md

@G0maa G0maa left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR #38 (re-review)

Commit: `efd4c9f53f70d2204dd08840e8f31628054e14a5`

Summary

Re-review after one new commit (`efd4c9f` "fix: formatting") was pushed on top of the previously-approved `3556890`. The new commit fixes a CI `format:check` failure.

Delta since prior approval

Verified with `git diff -w 3556890 efd4c9f -- docs/agdr/AgDR-0001-web-api-communication.md`. The delta is purely prettier reformatting of a single docs file:

  • Markdown table separator-row alignment (`|--------|` → `| ------ |`)
  • Emphasis-style normalization (`and` → `and`)
  • Blank line after "Concretely:"

`git diff -w` shows no semantic content change. Only `docs/agdr/AgDR-0001-web-api-communication.md` is touched. CI is now green (ci: SUCCESS).

Checklist Results

  • Architecture & Design: Pass (unchanged)
  • Code Quality: Pass (unchanged)
  • Testing: N/A (docs-only)
  • Security: Pass (unchanged)
  • Performance: N/A
  • PR Description & Glossary: Pass (unchanged)
  • Technical Decisions (AgDR):Pass — this PR is an AgDR back-fill
  • Adopter Handbooks: N/A (no diff-matched handbooks; docs-only delta)

Issues Found

None. The new commit is formatting-only with no behavioural or content impact.

Verdict

APPROVED — the prior content review at `3556890` still stands; the formatting-only delta introduces no new review surface. (Posted as a comment because GitHub blocks self-approval; the approval marker is written for the merge gate.)


🤖 Reviewed by Rex (Code Reviewer Agent)
📌 Reviewed commit: `efd4c9f53f70d2204dd08840e8f31628054e14a5`

@G0maa G0maa merged commit 27d4df0 into main May 27, 2026
3 checks passed
@G0maa G0maa deleted the docs/GH-11-agdr-web-api-communication branch May 27, 2026 14:03
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] Back-fill AgDR-0001 for web↔api communication decision

1 participant