Skip to content

docs(E1-11): register :feature:vehicle outbox payload entityType fix story - #41

Merged
davidru85 merged 2 commits into
mainfrom
story/E1-11-outbox-entitytype
Sep 1, 2026
Merged

docs(E1-11): register :feature:vehicle outbox payload entityType fix story#41
davidru85 merged 2 commits into
mainfrom
story/E1-11-outbox-entitytype

Conversation

@davidru85

Copy link
Copy Markdown
Owner

Summary

  • Registers GitHub issue [Bug]: Vehicle cascade Fuel Entry tombstone omits entityType #36 as backlog story E1-11 in Phase 1 of docs/BACKLOG.md, sized S.
  • The story restores docs/CONTRACTS.md §8 compliance of every outbox payload produced by VehicleOutboxMapper in :feature:vehicle.
  • Issue [Bug]: Vehicle cascade Fuel Entry tombstone omits entityType #36 reports only toFuelEntryTombstonePayload. Review of the same mapper found that toVehicleOutboxPayloadOrNull also omits entityType, which affects the vehicle create, update and tombstone write paths of SqlDelightVehicleRepository. Both omissions share one root cause and one fix surface, so the story covers both mappers rather than splitting into two PRs against the same file.
  • Documentation only. No code, schema or contract change. E1-11 itself remains open and unimplemented.

Story

E1-11 - :feature:vehicle Outbox Payload entityType Fix - S

This PR creates that story; it does not implement it.

Ready Check

  • Backlog story is explicit
  • Acceptance criteria reviewed
  • Dependencies checked
  • Required decisions are not Proposed or Pending
  • Normative sections reviewed
  • Expected verification identified
  • Human review gates identified before work

Scope Completed

  • Added the E1-11 section to docs/BACKLOG.md after E1-10, following the format of the surrounding Phase 1 stories: status line, scope statement, acceptance criteria, Blocks: line.
  • Added E1-11 to the dependency graph, to the execution-order rationale (why it must precede E2-06 and E3-03), and to the story index table.
  • Appended the required correction entry to docs/PROJECT_LOG.md.

Acceptance Evidence

The defect is confirmed in the current main:

  • feature/vehicle/src/commonMain/kotlin/com/ruizurraca/carapp/feature/vehicle/data/VehicleOutboxMapper.kt:29toFuelEntryTombstonePayload builds the payload with no entityType key (issue [Bug]: Vehicle cascade Fuel Entry tombstone omits entityType #36).
  • feature/vehicle/src/commonMain/kotlin/com/ruizurraca/carapp/feature/vehicle/data/VehicleOutboxMapper.kt:10toVehicleOutboxPayloadOrNull likewise omits entityType; called from SqlDelightVehicleRepository.kt:128 (create), :176 (update) and :203 (vehicle tombstone).
  • feature/fuel/src/commonMain/kotlin/com/ruizurraca/carapp/feature/fuel/data/FuelEntryOutboxMapper.kt:14 — the correct comparison path does emit put("entityType", "FUEL_ENTRY").
  • docs/CONTRACTS.md §8 requires schemaVersion and entityType in every outbox payload, and coalesces on (entityType, entityId) with ON CONFLICT DO UPDATE. A Vehicle cascade delete can therefore overwrite a conformant Fuel Entry payload with an incomplete one for the same key.

Test symbols named in the acceptance criteria were verified to exist:

  • VehicleRepositoryDeleteTest.permanentOwnerDeleteEnqueuesFuelTombstonesBeforeTheVehicleTombstone (VehicleRepositoryDeleteTest.kt:77)
  • VehicleRepositoryCreateTest.permanentOwnerCreateEnqueuesTheFullVehicleSnapshot (VehicleRepositoryCreateTest.kt:62)

Out of Scope / Not Done

  • The fix itself. This PR only registers the story; the mapper and test changes belong to the E1-11 implementation PR.
  • docs/CONTRACTS.md and docs/TECHNICAL_PLAN.md are deliberately untouched: the contract already mandates entityType, so this is a code-conformance defect, not a contract gap.

Files Changed

  • docs/BACKLOG.md — new E1-11 story, dependency-graph line, execution-order paragraph, story-index row.
  • docs/PROJECT_LOG.md — one correction entry.

Decisions Made

  • Both mappers in one story rather than two. Issue [Bug]: Vehicle cascade Fuel Entry tombstone omits entityType #36 scopes only the cascade tombstone. Splitting the Vehicle payload omission into a separate story would produce two PRs editing VehicleOutboxMapper.kt and its tests, with an avoidable conflict window. The story's status line records explicitly that the Vehicle payload omission is an additional finding, so the issue-to-story trace stays accurate.
  • No new decision record. No D-n is introduced: making code conform to an existing normative contract requires no decision.
  • The story carries an acceptance criterion noting that adding entityType will break the exact key-set assertion in VehicleRepositoryCreateTest, and that the assertion must stay exact so a future omission fails the build.

Verification Run

  • Relevant tests pass
  • Lint passes (ktlint, detekt)
  • Coverage thresholds hold
  • Architecture checks pass
  • Contract check passes
  • Relevant builds pass (Android, iOS simulator, Shared framework from :composition:ios)
  • Documentation updated if behaviour, decisions or models changed

No build or test verification was run, and none applies: the change touches two Markdown files and no compiled source. The verification listed under Acceptance Evidence is source inspection of the affected paths.

Contract Impact

  • No contract changes

Decision Board Impact

  • No decision changes

Shared-Write Modules Touched

  • None

Project Log Entry

  • Entry appended to docs/PROJECT_LOG.md

Human Review Gate

  • Not applicable

docs/BACKLOG.md is not a gated path under AGENTS.md §Human Review Gates, and registering a conformance fix for an already-normative requirement does not change MVP scope. Note that E1-11 blocks E2-06, which is itself a gated story; that gate applies to E2-06, not to this PR. docs/BACKLOG.md and docs/PROJECT_LOG.md are both owned by @davidru85 in CODEOWNERS, so this PR requires owner review regardless.

Risks or Follow-ups

  • E1-11 implementation is still open and MUST precede E2-06 and E3-03. E2-06 local owner adoption enqueues an outbox snapshot for every non-synced Vehicle and Fuel Entry row and coalesces snapshots onto cascade tombstones; a payload missing entityType makes those rows non-conformant with §8. E3-03 is the first consumer that assumes every outbox payload satisfies §8.
  • This PR closes the follow-up recorded in the 2026-09-01 E1-09 review-fixes log entry ("E1-11 backlog content was removed from this PR and needs its own PR"). The original commit b19ebc3, rebased out of PR E1-09: iOS UI: Vehicles and Fuel Entries #40 by finding B3, is superseded by this branch and needs no recovery.
  • GitHub issue [Bug]: Vehicle cascade Fuel Entry tombstone omits entityType #36 should be closed by the E1-11 implementation PR, not by this one.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AQXLTc8vuk3gUAsBc9qRcJ

davidru85 and others added 2 commits September 1, 2026 14:00
Register GitHub issue #36 as backlog story E1-11 in Phase 1. The story
restores docs/CONTRACTS.md §8 compliance of every outbox payload produced
by VehicleOutboxMapper in :feature:vehicle.

Issue #36 reports only the Fuel Entry tombstone written by the Vehicle
cascade-delete path. Review of the same mapper found that
toVehicleOutboxPayloadOrNull also omits entityType, which affects the
vehicle create, update and tombstone write paths of
SqlDelightVehicleRepository. Both defects share one root cause and one fix
surface, so the story covers both mappers.

E1-11 blocks E2-06 (local owner adoption enqueues an outbox snapshot for
every non-synced row and coalesces snapshots onto cascade tombstones, and
requires deterministic outbox order) and must precede E3-03 (the sync
engine is the first consumer that assumes every outbox payload satisfies
§8). The story is sized S, not human-gated, and introduces no schema or
contract change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AQXLTc8vuk3gUAsBc9qRcJ
Append the correction entry required by the Definition of Done for the
E1-11 backlog registration, and close the follow-up left by the 2026-09-01
E1-09 review-fixes entry, which recorded that the E1-11 backlog content was
removed from PR #40 and needed its own PR.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AQXLTc8vuk3gUAsBc9qRcJ
@davidru85
davidru85 deployed to cloud-runtime-verification September 1, 2026 12:03 — with GitHub Actions Active
@davidru85
davidru85 merged commit 44badc9 into main Sep 1, 2026
19 of 20 checks passed
@davidru85
davidru85 deleted the story/E1-11-outbox-entitytype branch September 1, 2026 12:35
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.

1 participant