feat(forge): domain model, Forge interface and contract-test harness #23

Merged
deadstyle merged 5 commits from feature/4-domain-forge-interface into develop 2026-10-02 11:53:28 -05:00
Owner

Closes #4.

Summary

  • internal/domain holds lazyforge's own types. Renovate data is a list of updates, one per PR-body table row, and change requests carry their head SHA.
  • internal/forge has the Forge interface, optional Approver, RunLister and LogReader, typed ItemRef for comment and close, MergeOpts.HeadSHA with ErrHeadChanged, and Gate/Can. Can combines adapter support, server version and repo permission, each with a reason.
  • internal/forge/forgetest has an in-memory Fake and RunContract, a suite every adapter must pass.
  • ADR 0006 records the shape and the GitHub/GitLab paper check. architecture.md matches the code.

Decisions

  • Opus: ADR 0006. Fable's second opinion was unavailable.
  • Ruling: the orchestrator wrote the scope from ADR 0006 instead of dispatching a planner, because the ADR already fixed every seam.

Test plan

  • Red-first tests written from the spec cover all four Can rules and their order, plus Fake behavior. RunContract runs against the Fake.
  • Mutation check: 63 of 64 mutants killed, and the survivor is equivalent. Six hollow tests found that way were strengthened.
  • Combined review passed. Low findings were fixed inline.
  • make check:
    0 issues.
    ok git.bobparsons.dev/deadstyle/lazyforge/internal/forge (cached)
    ok git.bobparsons.dev/deadstyle/lazyforge/internal/forge/forgetest 1.305s
    No vulnerabilities found.
    go build -ldflags "-X main.version=08ffa26" -o bin/lazyforge ./cmd/lazyforge

🤖 Generated with Claude Code

Closes #4. ## Summary - `internal/domain` holds lazyforge's own types. Renovate data is a list of updates, one per PR-body table row, and change requests carry their head SHA. - `internal/forge` has the `Forge` interface, optional `Approver`, `RunLister` and `LogReader`, typed `ItemRef` for comment and close, `MergeOpts.HeadSHA` with `ErrHeadChanged`, and `Gate`/`Can`. `Can` combines adapter support, server version and repo permission, each with a reason. - `internal/forge/forgetest` has an in-memory `Fake` and `RunContract`, a suite every adapter must pass. - ADR 0006 records the shape and the GitHub/GitLab paper check. `architecture.md` matches the code. ## Decisions - Opus: ADR 0006. Fable's second opinion was unavailable. - Ruling: the orchestrator wrote the scope from ADR 0006 instead of dispatching a planner, because the ADR already fixed every seam. ## Test plan - Red-first tests written from the spec cover all four `Can` rules and their order, plus Fake behavior. `RunContract` runs against the Fake. - Mutation check: 63 of 64 mutants killed, and the survivor is equivalent. Six hollow tests found that way were strengthened. - Combined review passed. Low findings were fixed inline. - `make check`: 0 issues. ok git.bobparsons.dev/deadstyle/lazyforge/internal/forge (cached) ok git.bobparsons.dev/deadstyle/lazyforge/internal/forge/forgetest 1.305s No vulnerabilities found. go build -ldflags "-X main.version=08ffa26" -o bin/lazyforge ./cmd/lazyforge 🤖 Generated with [Claude Code](https://claude.com/claude-code)
#4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add internal/domain types, the forge.Forge interface with Approver,
RunLister and LogReader capabilities, forge.Can, and forgetest.Fake
plus RunContract. Update architecture.md to match.

#4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #4

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
test(forge): tighten Fake copy and run-filter tests
All checks were successful
ci / check (pull_request) Successful in 1m6s
08ffa264cd
#4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deadstyle force-pushed feature/4-domain-forge-interface from 08ffa264cd
All checks were successful
ci / check (pull_request) Successful in 1m6s
to 11bd7903d5
All checks were successful
ci / check (pull_request) Successful in 41s
2026-10-02 11:52:22 -05:00
Compare
deadstyle merged commit 6f9ca314ee into develop 2026-10-02 11:53:28 -05:00
deadstyle deleted branch feature/4-domain-forge-interface 2026-10-02 11:53:28 -05:00
Sign in to join this conversation.
No description provided.