100 Commits

Author SHA1 Message Date
Jesse_Chen 075c62e579 fix(rectification): reset fresh cases to reported time 2026-08-15 17:50:51 +08:00
Jesse_Chen 6d192ad175 feat: add consultation and product domain registries 2026-08-15 06:04:23 +08:00
Jesse_Chen 5012ff7212 feat: add persistent personal report document v2 2026-08-15 05:10:37 +08:00
Jesse_Chen 83fef19779 feat: add rectification event decision contract v2 2026-08-15 00:56:06 +08:00
Jesse_Chen 21fce9513c feat(rectification): enforce v10 runtime and conversation focus 2026-08-14 22:49:18 +08:00
Jesse_Chen afc8af5b8e test(skill): enforce schema owner and receipt immutability 2026-08-14 16:52:35 +08:00
Jesse_Chen c1f1819de1 feat(skill): add immutable package registry and receipts 2026-08-14 16:37:53 +08:00
Jesse_Chen 2e17ccad64 fix(rectification): restore message actions and retry receipts
Independent Staging Quality Gate / validate (push) Failing after 30m22s
Independent Staging Quality Gate / publish (push) Has been skipped
2026-08-14 00:10:22 +08:00
Jesse_Chen 5800b2ad73 fix(rectification): allow accepted candidate reselection
Independent Staging Quality Gate / validate (push) Successful in 13m4s
Independent Staging Quality Gate / publish (push) Successful in 7m33s
2026-08-13 15:48:17 +08:00
Jesse_Chen 4deb5c2378 fix(rectification): start new case from homepage
Staging Backend Quality Gate / validate (pull_request) Successful in 24m42s
Staging Backend Quality Gate / publish (pull_request) Has been skipped
2026-08-12 21:21:26 +08:00
Jesse_Chen 746fdc184b fix(rectification): preserve assistant turns in dossier
Staging Backend Quality Gate / validate (pull_request) Successful in 17m28s
Staging Backend Quality Gate / publish (pull_request) Has been skipped
2026-08-12 15:33:04 +08:00
Jesse_Chen 397b6ef7c2 fix(rectification): surface real activity context
Staging Backend Quality Gate / validate (pull_request) Failing after 12m4s
Staging Backend Quality Gate / publish (pull_request) Has been skipped
2026-08-12 09:28:47 +08:00
Jesse_Chen b276bc8a8f fix(rectification): bind default session model
Staging Backend Quality Gate / validate (pull_request) Successful in 15m48s
Staging Backend Quality Gate / publish (pull_request) Has been skipped
2026-08-12 01:05:36 +08:00
Jesse_Chen d19d398221 fix(rectification): allow runtime flag reads
Staging Backend Quality Gate / validate (pull_request) Successful in 17m5s
Staging Backend Quality Gate / publish (pull_request) Has been skipped
2026-08-11 23:49:44 +08:00
Jesse b04dd1a9e0 merge: sync latest staging into rectification v9
# Conflicts:
#	docs/BUG_HISTORY.md
2026-08-11 18:08:42 +08:00
Jesse eddd52d1f3 fix(rectification): harden v9 runtime after adversarial review 2026-08-11 17:57:47 +08:00
Jesse_Chen c0e9a1c9f1 feat(admin): add safe account reset
Staging Backend Quality Gate / validate (push) Successful in 12m13s
Staging Backend Quality Gate / publish (push) Successful in 7m50s
2026-08-11 17:57:40 +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_Chen 620131d6a8 fix: keep foreground consultations responsive 2026-08-11 11:59:14 +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 32b683ebef fix(consult): preserve streaming across disconnects
Staging Backend Quality Gate / validate (push) Successful in 12m47s
Staging Backend Quality Gate / publish (push) Successful in 31m1s
2026-08-08 21:34:03 +08:00
Jesse_Chen eaa2e98f75 Fix admin model catalog visibility
Staging Backend Quality Gate / validate (push) Has been cancelled
Staging Backend Quality Gate / publish (push) Has been cancelled
2026-08-08 14:31:40 +08:00
Jesse_Chen a32d56677b Allow emergency model provider disable
Staging Backend Quality Gate / validate (push) Successful in 14m32s
Staging Backend Quality Gate / publish (push) Successful in 25m17s
2026-08-08 12:20:26 +08:00
Jesse_Chen 3089316d2e feat(admin): configure model providers from database 2026-08-07 20:03:20 +08:00
Jesse 280d3e7a35 feat(membership): replace purchase modal with membership page 2026-08-07 18:24:16 +08:00
Jesse_Chen f3946eaa6f chore: retire legacy rectification runtime
Staging Backend Quality Gate / validate (push) Failing after 9m57s
Staging Backend Quality Gate / publish (push) Has been skipped
2026-08-07 12:55:32 +08:00
Jesse_Chen 66a6c96a5c fix(admin): fail safe across migration and auth boundaries
The recovery migration crossed the identity and RBAC ledgers without guarding schema prerequisites, while unknown configuration, provider, and database failures escaped the admin authorization boundary as 500s. Keep recovery in the DB ledger with explicit prerequisite no-ops, and sanitize unknown authorization failures to the existing 503 path.
2026-08-07 12:08:58 +08:00
Jesse_Chen 754505d40a fix(admin): preserve revoked owners and 503 status
Owner recovery lived in the identity-only migration path and could clear historical revocations on conflict. Admin layout also rethrew authorization 503s, turning service-unavailable failures into 500 responses.\n\nMove recovery behind the RBAC migration sequence, exclude revoked candidates without mutating their history, and terminate layout redirects at a no-store 503 route.
2026-08-07 11:33:48 +08:00
Jesse_Chen 5622ab448a feat(admin): add operations resources and audit UI 2026-08-06 20:15:08 +08:00
Jesse_Chen 28e04857fa feat(models): secure catalog and pin model versions 2026-08-06 20:15:08 +08:00
Jesse_Chen 7040fd998e feat(billing): add products subscriptions orders and usage 2026-08-06 20:15:08 +08:00
Jesse_Chen 6457c836fa feat(admin): add RBAC identity and MFA controls 2026-08-06 20:15:08 +08:00
Jesse 82dab96b07 feat(report): add personal report contract and persistence 2026-08-06 12:43:10 +08:00
Jesse_Chen 5957803de4 Merge GitHub upstream into Gitea primary 2026-08-05 11:13:34 +08:00
Jesse_Chen 79fe2d6c69 fix: gate rectification candidate adoption flow 2026-08-04 16:47:23 +08:00
Jesse_Chen 8f6f4f511b feat: allow users to accept rectification candidates 2026-08-04 11:39:33 +08:00
Jesse_Chen 9417148b0a feat(rectification): add agentic birth-time rectification MVP
Add a new agentic rectification flow that lets an LLM drive the full
jyotish-vedic-astrology methodology on the web, with the Python engine as
its computation layer (mirroring local Claude Code):

- mastra/rectification-tools.ts: 7 engine tools (gate/scan/score/diagnostics/
  candidate-features/confirm/save-birth-time)
- mastra/agentic-rectification.ts: agent mounting the full skill + tools
- lib/rectification-agentic/session.ts: server-owned profile + confirmation
  gate; the LLM can only persist the exact minute the engine's high-rigor
  gate confirmed
- app/api/rectification/agent/route.ts: NDJSON streaming endpoint with
  credit reserve/settle
- components/rectification-agentic-chat.tsx + entry switch: new sessions use
  the agentic chat; in-progress v4 cases still resume on the v4 panel
- migration 20260801000000: service-role RPC writing profiles.active_birth_time
  with baseline concurrency guard
- tests for tools + session (12 cases); full suite passes 1076

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-01 02:20:00 +08:00
Jesse_Chen 453eacf3e2 feat(rectification): add adaptive director tool loop 2026-07-31 15:09:03 +08:00
Jesse_Chen a7a11a1a7a feat(rectification): drive questions from candidate contrast 2026-07-31 13:17:00 +08:00
Jesse_Chen bab5647afc fix(rectification): enforce director evidence boundaries 2026-07-31 06:13:47 +08:00
linmeng f4e35974c6 Revert "merge: sync GitHub staging to Gitea"
Deploy staging to test server / deploy (push) Failing after 14m49s
This reverts commit a55c69115d, reversing
changes made to 02c9c9f3d6.
2026-07-30 14:38:17 +08:00
Jesse_Chen 2384faf367 feat: harden rectification candidate validation 2026-07-30 10:55:39 +08:00
Jesse_Chen 0a5b8cd239 fix: restore rectification agent message actions 2026-07-30 00:41:48 +08:00
Jesse_Chen ee9d432762 feat: make rectification agent conversational 2026-07-29 17:49:19 +08:00
Jesse_Chen 8ade6ed5c8 refactor: rebuild birth time rectification agent 2026-07-28 13:04:30 +08:00
Jesse 02ec5db361 feat(admin): add audited Refine staging console 2026-07-28 09:47:13 +08:00
Jesse_Chen a550b98da7 refactor: make birth time rectification conversational 2026-07-27 22:33:12 +08:00
Jesse_Chen 2ca245d643 feat: rebuild birth time rectification workflow 2026-07-27 09:57:14 +08:00
Jesse_Chen cdf7a76766 fix: repair missing reported birth-time status 2026-07-26 13:14:14 +08:00