Commit Graph

23 Commits

Author SHA1 Message Date
Jesse_Chen 7d667fecbf fix(consult): treat pinched answers as failed and restore reply actions
Incomplete Flash generations were billed as completed consultations. Fail
those runs, keep the partial text, and reuse the rectification like/copy/rerun
bar on ordinary chat replies.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 19:40:50 +08:00
Jesse_Chen 7c7a25773c fix(rectification): let a tied plateau be adopted as the session result
Independent Staging Quality Gate / validate (push) Successful in 8m46s
Independent Staging Quality Gate / publish (push) Successful in 9m8s
Adjacent minutes still cannot confirm a unique birth minute. A scored
representative time can now be accepted, and the copy must say the minute
is not unique.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 10:41:47 +08:00
Jesse_Chen 52f3c04b3b refactor(chat): remove the post-answer suggestion chips and the table that fed them
Measured use of the three chips above the composer was negligible. They
were also not what they appeared to be: the server looked up a fixed
triplet by session theme and passed it as metadata that overrode
anything the model produced, so the same ten hardcoded sets served every
user regardless of question or chart. That is a plausible reason nobody
pressed them.

Both copies of the per-theme table are gone, reply metadata narrows to
the session title, and the two parse entry points collapse into one now
that they return the same shape. The write schema still tolerates a
suggestions field so a client on the previous bundle does not lose its
message mid-deploy, and stored answers containing the legacy hidden
block are still stripped rather than shown raw.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 15:44:19 +08:00
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 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 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 e8952dcc75 fix(rectification): place completion receipt above reply
Independent Staging Quality Gate / validate (push) Successful in 14m18s
Independent Staging Quality Gate / publish (push) Successful in 8m7s
2026-08-13 16:58:22 +08:00
Jesse_Chen 89f96dcfa5 fix(rectification): align activity with real agent work
Independent Staging Quality Gate / validate (push) Successful in 14m58s
Independent Staging Quality Gate / publish (push) Successful in 8m5s
2026-08-13 14:43:54 +08:00
Jesse_Chen 62d12c5c06 fix(rectification): render candidates and keep agent replies natural
Independent Staging Quality Gate / validate (push) Successful in 12m46s
Independent Staging Quality Gate / publish (push) Successful in 8m26s
2026-08-13 13:29:39 +08:00
Jesse_Chen 220828d6f0 fix(rectification): hydrate persisted case turns
Staging Backend Quality Gate / validate (pull_request) Successful in 15m6s
Staging Backend Quality Gate / publish (pull_request) Has been skipped
2026-08-12 10:45:49 +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 5dd0ab66a9 fix(rectification): isolate receipt activity after staging sync
Staging Backend Quality Gate / validate (push) Failing after 11m36s
Staging Backend Quality Gate / publish (push) Has been skipped
2026-08-11 18:22:30 +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_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 280d3e7a35 feat(membership): replace purchase modal with membership page 2026-08-07 18:24:16 +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 b9fe6a6be3 fix rectification session persistence 2026-08-04 00:38:16 +08:00
Jesse_Chen 1131e9eb3b fix(rectification): replace v4 entry with agent opening 2026-08-03 15:11:19 +08:00
Jesse_Chen e7c877c413 fix(rectification): start agent opening on mount 2026-08-02 23:57:30 +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