Make projection and watermark visible requirements, expose stale state accessibly, and add component regression coverage. Status remains IN_PROGRESS pending predecessor and UX evidence.
Document startup-only provider switching, immutable-artifact rollback, and mandatory visual/accessibility/performance evidence. Status remains IN_PROGRESS until rehearsal and predecessor evidence exist.
Validate extensible WBS identity integrity instead of an obsolete fixed row count. Preserve actual vendor-boundary and adapter-contract evidence; status remains IN_PROGRESS pending predecessor acceptance evidence.
- scripts/dba/grant-migration-test-db-ownership.sql: for a DBA to run,
fixes the kartsell_migration_test ownership regression blocking
DbUpMigrationTests/DbUpRecoveryTests (12 tests) locally.
- docs/CURRENT/PHASE-1_APPROVAL_CHECKLIST.md +
scripts/phase1/template-approve-versionset.sql: documents/templates the
human maker-checker approval steps needed to freeze a VersionSet before
Phase 1 shadow run can be re-queued. Does not perform any approval —
every placeholder must be filled by a real, named maker and a different
named checker. No automation should insert rows into dataset_manifest /
model_version_registry / evidence_snapshot / release_evidence_bundle.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Renumbers the four 2026-08-07 slices (ApprovalWorkflow, AuditTrail,
TradeExecution, PortfolioReconciliation) to previously-unused VS-26..29,
leaving WBS_MASTER.csv's original VS-03/04/12/14 definitions (IngestMarketDataPIT,
ApplyCorporateActions, RankBuyCandidates, GenerateDailyRecommendations) untouched,
per docs/DECISIONS/ADR-WBS-001-slice-renumbering.md.
While investigating, found two things not yet resolved by this commit:
- DEBT-017 (duplicate ApprovalWorkflow implementation): the tested backend
(ApprovalWorkflow/) is [DontRegister]'d dead code; the live one
(Features/ApprovalWorkflow/, wired in Program.cs) has no dedicated tests.
AEG-VS-26-01 downgraded from COMPLETED to BLOCKED in the tracker pending an
architect decision on which implementation is canonical.
- Features/MarketData and Features/Portfolio (VS-03/04/05/08 Market Data
Ingestion Dashboard, Portfolio Rebalance, Risk Metrics, Dashboard) are a
third, already-implemented-and-tested body of work entirely absent from
WBS_PROGRESS_TRACKER.csv. Flagged in CURRENT_ROADMAP.md as a follow-up.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Both docs were stale relative to 115 commits already on main (VS-03
Approval Workflow, VS-04 Audit Trail, AEG-X-009 live API integration,
Phase 3 J/K/L Sell Decision/Trade Execution/Portfolio Reconciliation),
and repeated an already-corrected false claim that Phase 1 shadow run
was RUNNING.
WBS_PROGRESS_TRACKER.csv:
- AEG-VS-03-01, AEG-VS-04-01: PLANNED/BLOCKED -> COMPLETED, with real
file paths, commit refs, and isolated test-run counts (20/20, 5/5)
as evidence.
- AEG-VS-10-01: BLOCKED -> COMPLETED (implementation), with an
explicit caveat that PBO/DSR production validation is separate and
still blocked on Phase 1 - not overclaiming past what's verified.
- Added AEG-VS-12-01 (Trade Execution) and AEG-VS-14-01 (Portfolio
Reconciliation), which had no tracker row at all despite being
merged to main.
- Flagged a real WBS_ID collision: WBS_MASTER.csv defines VS-03/04/12/14
as different, unrelated slices (IngestMarketDataPIT, ApplyCorporateActions,
RankBuyCandidates, GenerateDailyRecommendations). Per user decision,
kept the tracker's existing IDs and recorded the collision as
DECISION_REQUIRED on each affected row rather than silently
renumbering or picking a side.
- Softened AEG-VS-05-01/AEG-X-011/AEG-VS-09-01/AEG-VS-19-01 notes that
implied Phase 1 was actively counting down ("Job 976, ~50-90 days") -
corrected to say Phase 1 has not been queued.
- Re-confirmed PHASE-1-SHADOW-RUN unchanged: still no RunId/JobId
anywhere in this workspace.
CURRENT_ROADMAP.md: full rewrite. Dropped the 2026-08-03 snapshot
content, replaced with what's actually true today, and added a short
"how to re-verify this document" section (check git log divergence,
re-run tests in isolation not just as a full suite, confirm file paths
before writing COMPLETED) aimed at whoever updates this next.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
The SCP/DbMigrator deploy to the production target (178.104.200.7)
failed today with `relation "model_operations.models" does not
exist` at migration 0036 — the exact same failure I'd already hit
against a local test database, confirming this isn't environment
drift but a real, deterministic bug: no migration ever created
model_operations.models, only referenced it via FK (0036, 0038) and
queried it directly (OpenDartDailyBatchJob.cs). Migration 0037 had
the same class of bug for the `compliance` schema itself.
- Add 0035_model_operations_models.sql (must sort before 0036).
Scope is intentionally minimal — id/ticker/published_at/
correlation_id/revision, i.e. only what's actually referenced
today. The full Model Card/lifecycle schema is separate, larger
work and isn't guessed at here.
- Add `CREATE SCHEMA IF NOT EXISTS compliance;` to 0037, plus
IF NOT EXISTS on its indexes for re-run idempotency (matching the
rest of this migration set).
- Verified: full chain 0000->0040 applies to a fresh DB
("Upgrade successful") and re-run is a clean no-op
("No new scripts need to be executed").
Fixing the schema far enough to actually run queries against it
surfaced 3 more real, previously untested bugs in already-merged
code (none reachable before because the tables/schema didn't exist):
- Dapper was never configured for snake_case<->PascalCase column
mapping (`Dapper.DefaultTypeMap.MatchNamesWithUnderscores`), so
every Sql class's result-set queries were silently returning
null/default for every property instead of throwing. Fixed once,
centrally, via a `[ModuleInitializer]` in
KArtSell.BuildingBlocks/Data/DapperBootstrap.cs so it's set before
the first query regardless of entry point (Host/DbMigrator/tests).
- jsonb/inet columns written without an explicit cast
(`42804: column "x" is of type jsonb but expression is of type
text`) in AuditSql (details, ip_address), TradeSql (kis_response),
SellDecisionSql (oos_performance) — fixed with `::jsonb`/`::inet`
casts. AuditSql's jsonb read-back into Dictionary<string,object>
also needed a raw-DTO + JsonSerializer.Deserialize mapping.
- AuditSql.RedactAuditEventDetailsAsync had a literal duplicate
`SET details = ... details = ...` (invalid SQL) — nested the two
jsonb_set calls into one assignment.
Verified: dotnet build 0/0; architecture 13/13; unit 54/54+18/18;
Host boots cleanly and registers all 34 endpoints against the
now-complete schema.
New tech debt recorded: DEBT-020 (this fix), DEBT-021 (Dapper
snake_case fix), DEBT-022 (jsonb/inet casts, partial — not yet
audited beyond what surfaced), DEBT-023 (ApprovalSql.
InsertProposalAsync still fails on a raw DateOnly parameter — same
class of issue as DEBT-021, not yet fixed), DEBT-024 (TradeExecution
tests don't insert FK parent rows; one pure-logic ranker test
returned 1000 instead of 950 under the full suite, not yet
root-caused; DbUpMigrationTests fail locally on a Postgres role
permission gap unrelated to this fix).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Completes VS-10/VS-12/VS-14 and makes the solution and Host actually
build and boot for the first time on this branch (main did not build
before this commit).
Root-cause fixes required to reach a green build/boot (not scoped to
J/K/L but blocking any verification of it):
- Restore Polly PackageVersion accidentally deleted from
Directory.Packages.props (broke KArtSell.Host).
- Remove MediatR dependency from Compliance/VS-04 (package was never
installed; ICommand/ICommandHandler/IMediator never existed) and
wire Endpoint -> Handler directly per this repo's convention.
- Migrate FastEndpoints v5 API calls (SendOkAsync/SendAsync/
SendCreatedAtAsync/SendNotFoundAsync, Description().WithName()) to
the v7 Send.* fluent API across ~10 endpoint files.
- Fix migrations 0036/0038/0039/0040: rewritten from invalid T-SQL
(`IF NOT EXISTS ... BEGIN ... END`) to idiomatic Postgres
(`CREATE TABLE/INDEX IF NOT EXISTS`) — these could not apply to any
fresh database before this fix.
- Collapse 3 duplicate cross-cutting abstractions that shadowed the
BuildingBlocks versions and caused type-mismatch compile errors:
IKrxDataService, IOutboxWriter (ReconcileTradeHandler), IClock
(ApprovalWorkflow/ApprovalPolicy).
- Inject IClock (BuildingBlocks.Time) in place of direct
DateTime.Now/UtcNow across 19 files to satisfy the architecture
test AGENTS.md#DateTime-abstraction rule (13/13 architecture tests
now pass, was 12/13).
- Register all new and previously-unregistered slices in
Program.cs DI (SellDecision, TradeExecution, PortfolioReconciliation,
Compliance, Features/ApprovalWorkflow) — the Host had never
successfully completed a boot with this code present.
- Disable ("[DontRegister]") the older, route-colliding
ApprovalWorkflow/ (Workstream H) endpoint set in favor of
Features/ApprovalWorkflow/ (Workstream G, matches the documented
Features/<Slice>/ convention); kept for its existing test coverage.
See TECH_DEBT-017 for the follow-up decision needed.
Verified: dotnet build 0 errors/0 warnings; architecture tests 13/13;
unit tests 54/54 + 18/18; integration tests 34/36 (2 failures are a
local test-DB migration-journal/schema mismatch, not a code defect);
Host boots cleanly and registers all 34 endpoints.
New tech debt recorded: DEBT-017 (duplicate VS-03 implementation),
DEBT-018 (outbox write not co-transactional with entity write in
TradeExecution/PortfolioReconciliation), DEBT-019 (duplicate
BuildingBlocks-shadowing abstractions, partially resolved).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Deployment pipeline was computing version sequence (YYYY.MM.DD.N) by
counting existing vYYYY.MM.DD.* git tags, but the pipeline never created
those tags. Result: VERSION_SEQUENCE always resolved to 1, making the
"daily sequence" half of the contract decorative.
Now: After successful deployment to production, pipeline automatically
creates and pushes release tag vYYYY.MM.DD.N.SHA10 (e.g. v2026.08.07.1.abc1234567).
Uniqueness preserved even on same-day re-deploys. Permissions upgraded:
contents: read → write for tag push.
AGENTS.md: Right-Way (root cause fixed, not bandaged).
Ref: DEPLOY_FRONTEND_ARTIFACT_CONTRACT.md section "Bug Fix: Version Sequence Tagging"
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Tests now guard against accidental drop of kartsell_migration_test by throwing
when the credential source DB is the destructive rehearsal target. Distinct
credential DB (kartselldb_test) prevents config collision.
AEG-X-004 evidence consolidated: rehearsal .trx files + preflight markdown
documented. Schema 0032 (shadow_run_queued_status_contract) verified
fresh/upgrade/recovery on isolated DB.
AGENTS.md: Necessity-driven (guard against destructive accident); no new feature.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
New WbsWorkspacePage component under internal /internal/wbs route for
component preview and workspace management. Frontend rebuild generated
new bundle hashes (index-VG0yv2WA.js, index-BE8ymjzb.css) integrated
into Host wwwroot.
AGENTS.md: Necessity-driven (internal UI preview); Simplicity (no external API).
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>