Commit Graph

1391 Commits

Author SHA1 Message Date
Jesse eddd52d1f3 fix(rectification): harden v9 runtime after adversarial review 2026-08-11 17:57:47 +08:00
Jesse 724fb64c1a test(rectification): cover v9 migration rollout and regressions
- New suites: entry routing (13), evidence (11), skill/agent (13), stream (9),
  status/security (11) plus shared fake-accounting support.
- Migration static contract tests extended for the v9 agent api migration
  (run_phases, dossier/finalize/persist/accept/confirm RPCs, consent gate,
  needs_rebaseline guard, runtime flag, identity-foundation boundary).
- database-local-business.test.ts ledger + exact public table set updated
  (agentic_rectification_run_phases; BUG-127/BUG-144 boundary).
- rectification-v9-database.test.ts adds the agent-api migration test
  (flag seed, turn finalize, run phase receipt, consent rejection).
- rectification-agentic-entry.test.ts rewritten: the old tests locked in the
  hasRectificationSession + sessions.find guessing, textStream consumption and
  client-side session creation; they now assert the server-owned Case open
  flow, fullStream NDJSON, durable turns and exact-session routing.
- consultation-entrypoint / application-billing-contract rectification sections
  updated to the caseId-bound billing and open API contracts.
- docs/BUG_HISTORY.md: BUG-162 follow-up with regression record explaining why
  the old tests missed the broken entry guessing.
2026-08-11 17:18:08 +08:00
Jesse ca7484666f feat(rectification): stream agent execution and redesign entry routing
Replace the Direct Agentic textStream relay with a durable V9 agent runtime:

- agentic-rectification.ts: short boundary-only system prompt (no gate->scan
  ->score->diagnostics copy); pins skills/jyotish-birth-time-rectification;
  per-action bounded maxSteps (opening/read-only 6, evidence 8, rescore 12,
  accept/confirm 6) with a hard ceiling and repeated-tool-call detection.
- rectification-v9-tools.ts: ten Case-ref tools (read-case, propose/confirm/
  revise-evidence, compare-candidates, read-diagnostics, offer-candidates,
  accept-candidate, confirm-birth-time, close-case). Inputs are minimal refs
  only; RPC-backed evidence ledger, fingerprint cache reuse, receipts, and
  accepted!=confirmed semantics; confirm requires gate + grounded consent.
- /api/rectification/agent: caseId/sessionId/requestId/action/message; exact
  Case<->Session binding verified server-side; client history never overrides
  the durable dossier; pending turn -> completed/failed/retryable; consumes
  result.fullStream and emits allowlisted NDJSON only (reasoning/raw/provider
  metadata/tool payloads/birth data/scores never forwarded); first-turn real
  skill.started/skill.loaded gate with one controlled retry; billing bound to
  rectification:case:{caseId}.
- New forward migration 20260813010000_agentic_rectification_v9_agent_api.sql:
  case dossier/compute, turn finalize, fingerprint-cached candidate persist,
  case-scoped accept, consent-gated confirm, guarded transitions,
  needs_rebaseline profile guard, run_phases receipt table, and the
  rectification_runtime_version feature flag (v9 default, legacy read-only).
- Frontend: homepage/sidebar entry routing now uses the server Case open API
  (openRectificationFromHomepage/openRectificationSession/startNewRectification)
  with exact sessionId/caseId and server-owned shouldStartOpening; CTA driven
  by entry-summary; chat restores from persisted turns, candidate cards from
  the Candidate Snapshot API, activity from real NDJSON + persisted receipts;
  direct durable candidate-accept endpoint for the UI cards.
2026-08-11 17:17:56 +08:00
Jesse d394dd0585 feat(rectification): add durable case and evidence runtime 2026-08-11 16:18:53 +08:00
Jesse 60e2ce4fa4 feat(rectification): add v9 skill and domain contracts 2026-08-11 16:18:49 +08:00
Jesse_Chen 6d7a9a97be merge: consultation fixes into staging
Staging Backend Quality Gate / validate (push) Successful in 12m19s
Staging Backend Quality Gate / publish (push) Successful in 8m44s
# Conflicts:
#	docs/BUG_HISTORY.md
2026-08-11 12:00:25 +08:00
Jesse_Chen c065598d52 merge: storefront fixes into staging 2026-08-11 11:59:35 +08:00
Jesse_Chen 620131d6a8 fix: keep foreground consultations responsive 2026-08-11 11:59:14 +08:00
Jesse_Chen ce46aae5c8 fix: polish storefront account and membership state 2026-08-11 11:59:03 +08:00
Jesse_Chen 8eed0603f9 fix(admin): allow administrator list reads
Staging Backend Quality Gate / validate (push) Successful in 12m30s
Staging Backend Quality Gate / publish (push) Successful in 7m37s
2026-08-11 00:10:24 +08:00
Jesse_Chen 10724e9dab fix: request official VedAstro evidence in gateway
Staging Backend Quality Gate / validate (push) Successful in 11m17s
Staging Backend Quality Gate / publish (push) Successful in 6m26s
2026-08-10 20:17:35 +08:00
Jesse_Chen b637528f14 fix: propagate consultation evidence before audit
Staging Backend Quality Gate / validate (push) Successful in 12m37s
Staging Backend Quality Gate / publish (push) Successful in 8m25s
2026-08-10 19:40:11 +08:00
Jesse 2697d16ef1 feat(identity): test-only fixed OTP channel and rectification candidate cards
Staging Backend Quality Gate / validate (push) Has been cancelled
Staging Backend Quality Gate / publish (push) Has been cancelled
- IDENTITY_TEST_OTP env: when set to a 6-digit code, no real email is
  delivered; login page surfaces the fixed code so testers can register
  and sign in without a mailbox. Opt-in, never set in production.
- email-otp-login: test-channel notice with the pinned code.
- Rectification candidate list restyled with the project design system
  (warm canvas, action color, display serif, soft shadow, hover lift).
- Regression tests for config parsing, pinned OTP generation, login UI
  notice, and candidate card styles.
2026-08-10 19:38:27 +08:00
Jesse ed2294875b merge: sync origin/main (22bbf8ab) into docs/correct-report-smoke
Staging Backend Quality Gate / validate (push) Successful in 11m30s
Staging Backend Quality Gate / publish (push) Successful in 6m49s
Resolve conflicts:
- globals.css: keep origin/main disabled opacity 1 (BUG-140 parity)
- consultation-entrypoint.test.ts: keep origin/main sticky-hover + disabled rules
- BUG_HISTORY.md: keep origin/main BUG-139 (staging admin), renumber local
  Python prework fix to BUG-158
2026-08-10 17:59:37 +08:00
Jesse 8fb6b65b01 wip: local BUG-139/BUG-140 fixes before syncing origin/main
- pre_work_check.py: prefer repo .venv Python >=3.11, strict JYOTISH_PRE_WORK_PYTHON override, fail closed
- tests/test_pre_work_check.py: regression coverage for venv preference / system 3.9 / strict override
- globals.css: transient :active pressed feedback for entrypoint cards, hover only under (hover: hover)
- consultation-entrypoint.test.ts: sticky-hover regression test
- BUG_HISTORY.md: BUG-139 / BUG-140 records
- pre_work_error_ledger.md: ERR-078 resolved entry
2026-08-10 17:57:06 +08:00
Jesse_Chen 22bbf8abf2 fix: restore report creation and sidebar alignment
Staging Backend Quality Gate / validate (push) Successful in 10m2s
Staging Backend Quality Gate / publish (push) Successful in 8m11s
2026-08-10 17:33:18 +08:00
Jesse_Chen 07ea504e91 fix: align report technique audit evidence
Staging Backend Quality Gate / validate (push) Successful in 10m37s
Staging Backend Quality Gate / publish (push) Has been cancelled
2026-08-10 17:18:52 +08:00
Jesse_Chen 455917a870 ops: keep production SSH sessions alive
Staging Backend Quality Gate / validate (push) Successful in 10m16s
Staging Backend Quality Gate / publish (push) Successful in 2m8s
2026-08-10 16:17:41 +08:00
Jesse_Chen a0f8118e32 ops: read production migration revision from container
Staging Backend Quality Gate / validate (push) Successful in 11m33s
Staging Backend Quality Gate / publish (push) Successful in 2m4s
2026-08-10 15:31:35 +08:00
Jesse_Chen 64382c879d fix: allow admin OTP password status
Staging Backend Quality Gate / validate (push) Successful in 12m11s
Staging Backend Quality Gate / publish (push) Successful in 12m43s
2026-08-10 11:52:14 +08:00
Codex 65bcef3001 feat: add global asynchronous report center
Staging Backend Quality Gate / validate (push) Has been cancelled
Staging Backend Quality Gate / publish (push) Has been cancelled
2026-08-09 20:24:09 -07:00
Jesse_Chen a17ff258d8 fix: correct membership back flow and add onboarding paywall
Staging Backend Quality Gate / validate (push) Has been cancelled
Staging Backend Quality Gate / publish (push) Has been cancelled
2026-08-10 11:14:31 +08:00
Jesse_Chen 8696eca022 fix: keep one active email OTP per account
Staging Backend Quality Gate / validate (push) Successful in 12m39s
Staging Backend Quality Gate / publish (push) Successful in 12m9s
2026-08-10 10:49:25 +08:00
Jesse_Chen 43d0647de2 ops: read production revision from container
Staging Backend Quality Gate / validate (push) Successful in 10m15s
Staging Backend Quality Gate / publish (push) Successful in 2m17s
2026-08-10 06:58:51 +08:00
Jesse_Chen 8823597f4c ops: accept direct host isolation during internal verify
Staging Backend Quality Gate / validate (push) Successful in 22m15s
Staging Backend Quality Gate / publish (push) Successful in 10m8s
2026-08-10 05:27:24 +08:00
Jesse_Chen 7a24a8d387 ops: harden production data migration
Staging Backend Quality Gate / validate (push) Successful in 10m5s
Staging Backend Quality Gate / publish (push) Successful in 9m18s
2026-08-10 04:19:24 +08:00
Jesse_Chen 18459f03d7 ops: fix internal production host probes
Staging Backend Quality Gate / validate (push) Successful in 12m6s
Staging Backend Quality Gate / publish (push) Successful in 5m8s
2026-08-10 03:41:25 +08:00
Jesse_Chen f6b3301035 ci: pin release gate to Node 22
Staging Backend Quality Gate / validate (push) Successful in 13m25s
Staging Backend Quality Gate / publish (push) Successful in 5m4s
2026-08-10 02:31:35 +08:00
Jesse_Chen 417417835a ci: stabilize release dependency install
Staging Backend Quality Gate / validate (push) Successful in 12m45s
Staging Backend Quality Gate / publish (push) Successful in 8m43s
2026-08-10 00:56:40 +08:00
Jesse_Chen ac0b218c90 hide report PDF action
Staging Backend Quality Gate / validate (push) Successful in 21m7s
Staging Backend Quality Gate / publish (push) Successful in 12m9s
2026-08-09 23:20:36 +08:00
Jesse_Chen a77fb514cb ci: run release gate on compose runner
Staging Backend Quality Gate / validate (push) Has been cancelled
Staging Backend Quality Gate / publish (push) Has been cancelled
2026-08-09 23:17:29 +08:00
Jesse_Chen 9235ee66f6 keep staging image build on turbopack
Staging Backend Quality Gate / validate (push) Successful in 17m58s
Staging Backend Quality Gate / publish (push) Successful in 4m14s
2026-08-09 22:14:40 +08:00
Jesse_Chen 4f3f842958 avoid duplicate staging production build
Staging Backend Quality Gate / validate (push) Successful in 12m20s
Staging Backend Quality Gate / publish (push) Failing after 47m39s
2026-08-09 21:06:47 +08:00
Jesse_Chen 1db36b19b4 fix bounded standalone production build
Staging Backend Quality Gate / validate (push) Failing after 23m55s
Staging Backend Quality Gate / publish (push) Has been skipped
2026-08-09 20:37:02 +08:00
Jesse_Chen e1878ed511 fix standalone web health binding
Staging Backend Quality Gate / validate (push) Failing after 24m24s
Staging Backend Quality Gate / publish (push) Has been skipped
2026-08-09 19:35:41 +08:00
Jesse_Chen e22d4fafa4 fix staging migration checker image
Staging Backend Quality Gate / validate (push) Successful in 21m52s
Staging Backend Quality Gate / publish (push) Successful in 4m24s
2026-08-09 18:29:20 +08:00
Jesse_Chen de857190d7 fix staging web image publish
Staging Backend Quality Gate / validate (push) Successful in 20m41s
Staging Backend Quality Gate / publish (push) Successful in 19m4s
2026-08-09 17:34:43 +08:00
Jesse_Chen b40f3a1cf0 fix staging npm ci in-container timeout
Staging Backend Quality Gate / validate (push) Successful in 16m27s
Staging Backend Quality Gate / publish (push) Failing after 55m53s
2026-08-09 16:06:16 +08:00
Jesse_Chen ffbe505c23 fix: complete production data migration rehearsal
Staging Backend Quality Gate / validate (push) Failing after 49m36s
Staging Backend Quality Gate / publish (push) Has been skipped
2026-08-09 14:17:01 +08:00
Jesse_Chen d36ca7aac2 ops: align production ETL with legacy admin source 2026-08-09 13:53:07 +08:00
Jesse_Chen 664d8adbf0 docs: preserve production password login exception
Staging Backend Quality Gate / validate (push) Failing after 51m41s
Staging Backend Quality Gate / publish (push) Has been skipped
2026-08-09 13:20:06 +08:00
Jesse_Chen f53e2d09ed ops: add production PostgreSQL migration tooling 2026-08-09 13:20:06 +08:00
Jesse_Chen 04c4bd3ead ci: isolate staging dependency install
Staging Backend Quality Gate / validate (push) Has been cancelled
Staging Backend Quality Gate / publish (push) Has been cancelled
2026-08-09 13:18:47 +08:00
Jesse_Chen 918b02ff0a ci: retry staging checkout
Staging Backend Quality Gate / validate (push) Successful in 15m39s
Staging Backend Quality Gate / publish (push) Failing after 50m3s
2026-08-09 09:41:56 +08:00
Codex 9b07e12b0c ops: prepare self-hosted production migration
Staging Backend Quality Gate / validate (push) Has been cancelled
Staging Backend Quality Gate / publish (push) Has been cancelled
2026-08-08 21:12:55 -04:00
Jesse_Chen 61673d3a8b test: register membership orders route
Staging Backend Quality Gate / validate (push) Successful in 13m3s
Staging Backend Quality Gate / publish (push) Has been cancelled
2026-08-09 09:00:43 +08:00
Jesse_Chen ac870d84d6 fix staging reports and membership navigation
Staging Backend Quality Gate / validate (push) Failing after 14m31s
Staging Backend Quality Gate / publish (push) Has been skipped
2026-08-09 08:36:14 +08:00
Jesse_Chen b3f06efc30 ci: retry staging image publish
Staging Backend Quality Gate / validate (push) Successful in 14m10s
Staging Backend Quality Gate / publish (push) Successful in 7m35s
2026-08-09 02:44:45 +08:00
Jesse_Chen 34395e902c fix(chat): follow active response at bottom
Staging Backend Quality Gate / validate (push) Successful in 11m13s
Staging Backend Quality Gate / publish (push) Has been cancelled
2026-08-09 01:19:39 +08:00
Jesse_Chen 17430a1f21 fix(reports): trust verified proxy origin
Staging Backend Quality Gate / validate (push) Successful in 12m13s
Staging Backend Quality Gate / publish (push) Has been cancelled
2026-08-09 00:54:55 +08:00