Skip to content

J4: typed write-path + auth - #4

Merged
matt82198 merged 1 commit into
masterfrom
feat/j4-write-path
Jul 26, 2026
Merged

matt82198 merged 1 commit into
masterfrom
feat/j4-write-path

Conversation

@matt82198

Copy link
Copy Markdown
Owner

Summary

Implements J4 write-path with auth: inbox-mediated tracker transitions preserving single-writer discipline.

  • POST /api/v1/tracker/items/{id}/transitions validates state, appends to orchestrator inbox (202 Accepted)
  • POST /api/v1/inbox generic note appends
  • Static bearer token auth via AESOP_SERVER_TOKEN env (503 if unset, fail-closed)
  • Validation: checks current projected state via EventStoreReader, rejects same-status transitions
  • Inbox format: one JSON object per line (ts, source, kind, itemId, targetStatus, note)
  • Concurrency: ReentrantLock + UTF-8 fsync for crash-safe concurrent appends

Test Plan

  • Controller tests: transition validation (legal/illegal), 202 shape, 401 wrong token, 503 no token, optional note field
  • Service tests: JSON format golden test, UTF-8 encoding, multi-append, concurrent 10-thread appends, parse integrity
  • All 57 tests green (unit + integration + soak)
  • Soak test: 156 Python writes, 308 concurrent Java reads, WAL contention zero

What's Next

  • Manual verification with running jar + curl
  • Merge on green
  • Update README with J4 section

🤖 Generated with Claude Code

…}/transitions)

TDD implementation of tracker transition endpoints for J4 write-path phase:
- POST /api/v1/tracker/items/{id}/transitions: append inbox requests
- POST /api/v1/inbox: generic note appends
- Static bearer token auth via AESOP_SERVER_TOKEN env (503 if unset)
- Validation: transition checks current projected state, rejects same-status
- Inbox format: one JSON object per line (ts, source, kind, itemId, etc)
- Concurrent append safety: ReentrantLock + fsync for crash safety
- 202 Accepted response (orchestrator applies asynchronously)

Tests: 7 controller tests (validation, auth, 202 shape) + 8 service tests
(JSON format, UTF-8, concurrent 10-thread appends, parse integrity).
All 57 tests green; soak test: 156 writes, 308 concurrent reads.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@matt82198
matt82198 merged commit aebee7a into master Jul 26, 2026
8 checks passed
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