genichin
e6b6a8715b
feat: implement daemon model with registry and single-asset assignment (BAT-010, REQ-023/028)
...
Core Implementation (BAT-010):
- Add daemon registry schema and CRUD operations (req-023)
- Implement single-daemon asset assignment constraint (one asset per daemon)
- Add daemon_id field to service_token for daemon identification
- Add daemon.py CLI module for daemon management commands
- Add 20260513_0016_daemon_model.py migration for daemon tables
API Changes:
- GET /v1/assets: include daemon_id in AssetResponse
- POST /v1/assets/{asset_id}/ledger/trades: require daemon token binding
- GET /v1/user_info: include daemon metadata
- Enhanced service-token rotate to preserve daemon bindings
CLI Commands:
- pfhub daemon register --name <name> --runtime-id <runtime-id>
- pfhub daemon list
- pfhub daemon get <daemon-id>
- pfhub daemon revoke <daemon-id>
Requirements (REQ-023, REQ-028):
- REQ-023: Daemon Registry and Service Token Daemon Binding (Interface, Approved)
* AC-1: daemon CRUD operations
* AC-2: service token daemon binding for POST /v1/assets/{asset_id}/ledger/trades
* AC-3: single daemon per asset (exact-one assignment model)
- REQ-028: README.md Daemon Provisioning Runbook update (Documentation, Approved)
Documentation:
- Add dcy-006 Discovery for daemon-id and single-daemon asset assignment
- Update README.md with Daemon Provisioning Runbook section
- Add BAT-010 batch documentation with planning, implementation, verification
- Update rel-006 release document (daemon model implementation)
- Update data-model.md with daemon and daemon_asset_assignment tables
- Update interface-contract.md with daemon registry APIs
- Update runtime-flows.md with daemon lifecycle flows
Breaking Changes:
- REQ-005~009, REQ-011~012 status reverted to Approved due to revised contract
* daemon_id field addition and exact-one asset assignment requirement
* Existing Implemented evidence invalidated by contract revision
* BAT-001/002/008 re-verification required
Testing:
- Add test_daemon_registry.py for daemon CRUD operations
- Add test_daemon_assignment.py for single-asset assignment constraints
- Update test_auth.py, test_cli.py, test_v1.py for daemon support
- Verify daemon token binding in trade endpoint authorization
Impact:
- Database: 2 new tables (daemons, daemon_asset_assignments)
- Migration: 20260513_0016 creates daemon model schema
- CLI: 4 new daemon subcommands
- API: daemon_id propagation through v1 endpoints
- Verification: BAT-001/002/008 re-verification gates next release
2026-05-13 23:07:24 +00:00
genichin
03bc3dcd8f
docs: add rel-005 production operator runbook and credential matrix (REQ-020~022)
...
Release: REL-005_20260512 — Production Operator Runbook and Credential Matrix
Requirements Approved (REQ-020~022):
- REQ-020: production admin bootstrap and steady-state operator access runbook (Deployment)
- REQ-021: release credential matrix and token provenance procedures (Documentation)
- REQ-022: operator log access and release evidence recording procedures (Documentation)
Batch: BAT-009
- Enhance README.md Production Operator Runbook section with:
- Deployment secret custodian role labels
- Release approver and production operator role definitions
- Credential matrix table (public/read/trade-write/admin permission levels)
- Canonical smoke environment specifications
- HTTP status code interpretation (401/403/404)
- Release evidence recording fields
Documentation Updates:
- Add README.md Section 2: deployment roles and responsibilities
- Add README.md Section 3: 4-tier credential matrix with token usage patterns
- Enhance README.md Section 6: smoke test procedures and evidence capture
- Add bootstrap/steady-state/break-glass 3-tier access pathway clarification
- Create REQ-020 Deployment runbook document
- Create REQ-021 credential matrix procedures document
- Create REQ-022 operator log access procedures document
Discovery & Release:
- Update dcy-005 with operator access requirements analysis
- Create rel-005 with docs-only profile and deployment notes
- Update docs/batches/index.md with BAT-009 entry
- Update docs/srs/index.md with REQ-020~022 entries and change log
2026-05-12 23:19:48 +00:00
genichin
a5b5e7a93c
fix: resolve SRS conflicts from batch verification analysis (CONFLICT-1~4)
...
Conflict Resolutions:
- CONFLICT-1 (High): Fix REQ-006 ownership scope — implement owner_user_id filtering
* Change app/api/v1_assets.py: owner_user_id=None → owner_user_id=auth.user_id
* Update docs/runtime-flows.md to reflect service-token owner-scoped portfolio filtering
* Add regression test in tests/test_v1.py for ownership boundary
- CONFLICT-2 (Medium): Transition REQ-001/002/003 to Implemented
* REQ-001: local-db-validation-scenarios (via confirm-req-implemented bat-007)
* REQ-002: alembic-runtime-schema-ownership (via confirm-req-implemented bat-007)
* REQ-003: local-db-operations-runbook-and-baseline-updates (via confirm-req-implemented bat-007)
* Update docs/srs/index.md with status transitions
- CONFLICT-3 (Low): Document REQ-012 rotate lifecycle
* Add rotate lifecycle notes to REQ-012 (change-req req-012)
* Clarify runtime_id change behavior and trex-basic reconnection requirements
- CONFLICT-4 (Low): Clarify REQ-005 AC-2 endpoint path
* Change REQ-005 AC-2: 'POST /auth/tokens or equivalent' → 'POST /auth/service-tokens'
* Update docs/srs/index.md change log with change-req entries
Documentation Updates:
- Update BAT-001 verification status with conflict resolution evidence
- Update release rel-001 with verified status confirmation
- Add change log entries for all conflict resolutions with dates and references
Testing:
- Add ownership boundary test to test_v1.py
- Verify filter works with auth.user_id context
2026-05-11 11:57:21 +00:00
genichin
829629fa8f
feat: implement portfolio UUID migration and v1 API finalization (BAT-006, BAT-001 re-verified)
...
Core Changes:
- Migrate portfolio_id from string to UUID in schema and repository layer
- Update portfolio CLI commands to use name+user combination for identification
- Update HTTP API to accept portfolio_id as UUID path parameter
- Implement portfolio ownership validation in repository queries
Requirements Completed (REQ-016 to REQ-019):
- REQ-016: portfolios table UUID schema migration with data migration script
- REQ-017: CLI portfolio commands with name+user identification
- REQ-018: HTTP API portfolio path parameters and v1 asset_id UUID returns
- REQ-019: Portfolio UUID baseline documentation updates
BAT-001 Re-verification:
- REQ-004~010 marked as Implemented after verification evidence validation
- All v1 API endpoints verified with comprehensive test coverage
Documentation Updates:
- Update data-model.md with portfolio UUID structure
- Update interface-contract.md with UUID path parameters
- Update runtime-flows.md with ownership-based resolution flows
- Update project-structure.md with database layer changes
- Add migration script for portfolio UUID transition
Testing:
- Add test_portfolio_uuid.py for migration validation
- Update test_cli.py and test_portfolio_ownership.py for ownership checks
2026-05-11 09:27:57 +00:00
genichin
545d4da413
feat(REQ-006): implement v1 assets endpoint with verification
...
- Add v1_assets.py API endpoint for asset list retrieval
- Add AssetResponse schema to v1.py
- Implement comprehensive test coverage in test_v1.py
- Update requirement verification with implementation evidence
- Update SRS index to mark REQ-006 as Implemented
- Document acceptance criteria validation results
2026-05-03 13:36:27 +00:00
genichin
222c66bb7f
feat(BAT-005): add broker credential CLI command with persistence and tests
...
- Add CredentialService for managing broker credentials
- Implement credential CLI commands (create, list, get, update, delete)
- Add postgres repository support for credential operations
- Add comprehensive test coverage for credential CLI
- Update docs/batches/index.md and docs/srs/index.md with BAT-005
- Update docs/project-structure.md to reflect credential service
2026-05-03 12:44:40 +00:00
genichin
a111fdd83f
feat(REQ-014): add portfolio-create-user-required requirement and implementation
...
- Add docs/srs/Interface/req-014_portfolio-create-user-required.md with acceptance criteria
- Create docs/batches/bat-004_20260502_portfolio-create-user-required/ delivery batch
- Enhance app/cli/commands/portfolio.py: validate user_id parameter before portfolio creation
- Add comprehensive CLI tests in tests/test_cli.py for portfolio create validation flows
- Update docs/batches/index.md and docs/srs/index.md with new requirement/batch references
- Update README.md documentation
2026-05-02 13:45:46 +00:00
genichin
2f686f79ce
feat(req-013): add portfolio-list-user-required requirement and batch
...
- Add REQ-013: Portfolio list filtered by user requirement with acceptance criteria
- Add DCY-003 discovery document for portfolio list user filtering
- Create BAT-003 batch with planning, design, implementation, and verification
- Enhance app/cli/commands/portfolio.py with user-based list filtering
- Add comprehensive tests for portfolio list CLI command with user filtering
- Update docs indices (discovery, srs, batches)
- Improve README with latest capability status
2026-05-02 13:22:41 +00:00
genichin
b4d964253b
feat(REQ-012): implement service token rotation CLI
...
- Add service token rotation CLI command with force flag support
- Implement token rotation in auth service with expiration handling
- Add portfolio repository helper for transaction/batch operations
- Add cascade delete support in postgres repository
- Add comprehensive CLI tests for service token operations
- Add REQ-012 specification for service token rotation
- Create BAT-002 delivery batch for token rotation implementation
- Update SRS and batch indexes
2026-05-02 12:43:43 +00:00
genichin
3509606c7e
feat(REQ-005): implement TrEx Basic V1 API contract with auth, assets, ledger, and user endpoints
...
- Add V1 API routes for assets, ledger, and user info with complete CRUD operations
- Implement authentication scopes and request validation via auth_routes.py
- Extend schemas with V1-specific models for accounts, holdings, and positions
- Add database queries and aggregations for P&L, performance, and account data
- Include comprehensive test coverage for all V1 endpoints and integration flows
- Update batch and release documentation with implementation and verification evidence
- Sync project structure and runtime flows per V1 API contract requirements
Closes implementation phase of BAT-001 (TrEx Basic V1 API Contract)
2026-05-02 11:37:42 +00:00
genichin
ce63c75c9c
feat(V1-API): implement TREX-Basic consumer API contract with encryption and persistence
...
- Add V1 API endpoints: assets, ledger, user-info
- Implement Fernet-based credential payload encryption (req-010)
- Extend health response schema with runtime info (req-004)
- Add service token runtime ID issuance (req-005)
- Implement database schema migration for V1 API (req-009)
- Add comprehensive test coverage for V1 endpoints
- Update SRS with 10 new requirements (REQ-004 through REQ-011)
- Create batch planning, design, and verification for BAT-001
- Integrate review-discovery StagePilot skill
- Update documentation indices and baseline specs
2026-05-02 09:06:15 +00:00
genichin
e362de205f
chore: initialize StagePilot baseline documentation and discovery/SRS/batches/releases structure
2026-04-30 13:19:48 +00:00