Commit Graph

1803 Commits

Author SHA1 Message Date
Jesse_Chen 90bad10d6f feat(report): carry engine interpretive facts into the evidence bundle
The consultation workflow already returns a functional benefic/malefic
table, a shadbala ranking, SAV scores, the current maha/antardasha,
detected yogas and guided-topic copy. The report extraction layer threw
all of it away, so claim cards could only say "the server closed the
minimum evidence group" and the writer had no conclusions to work from.

- ReportEvidenceBundleV2 gains interpretiveFacts (yogas, functionalRoles,
  shadbalaRanking, savScores/savTotal, currentDasha, convergenceDomains)
  and themeNarrativeSeeds. Both are required, allow empty, keep .strict(),
  are covered by the canonical sort + bundleHash, and fail closed on
  dangling refs, duplicate ranks/houses/themes and out-of-bound text.
- Extraction is allowlist-style: closed enums for yoga category and
  functional role, safeCelestialName for planets, sign->whole-sign-house
  projection for SAV, and a forbidden-token scrub that drops any seed line
  naming an external provider or internal route.
- Claim card conclusions and supportingFacts are now deterministic
  astrological statements built from those facts; risks become
  counterFacts. assertionLevel derivation is unchanged, and a theme with
  no seed keeps the old receipt wording with consensus capped down.
- filterReportEvidenceBundleForSection trims seeds and SAV houses to the
  chapter's theme while letting the chart-wide interpretive receipts ride
  along, so every section can cite them.

Contract snapshot taken from a real local /api/consultation_workflow call
with fictional smoke birth data; the new fixture test locks the shapes
that call actually returns, including the fields that are absent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016P5RoqzmUQEbeC2qjAkeGr
2026-09-01 20:35:02 +00:00
Jesse_Chen 551d6317ae refactor(chat): extract consultation and session hooks after contract repairs
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
Keep archive as a PATCH of archived_at rather than DELETE, pass entry_mode through onboarding, and let popstate to the default chat reuse selectSession. Then move send/stop/recovery and session management out of page.tsx so the home surface stays within the batch-two line budget.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 04:34:14 +08:00
Jesse_Chen 8b7eda9f2d docs(report): add skill-parity evidence and knowledge-pack task brief
Independent Staging Quality Gate / validate (push) Successful in 18m35s
Independent Staging Quality Gate / publish (push) Successful in 12m36s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016P5RoqzmUQEbeC2qjAkeGr
2026-09-01 18:17:27 +00:00
Jesse_Chen 8617eb565c docs(voice): add task E — opening dedupe and user_meaning layering
Independent Staging Quality Gate / validate (push) Failing after 15m32s
Independent Staging Quality Gate / publish (push) Has been skipped
硬编码盘点新发现的两处定位错误:opening 轮双重提问去重(结构化
判定,不用正文正则);引擎 user_meaning 作为素材分层,指令语气
不得直出用户。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155nFCgCHtoA7jhSDGmZmMu
2026-09-01 15:40:51 +00:00
Jesse_Chen ebb7086601 docs(voice): add agent output humanity task brief
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
咨询 prompt 九成禁令无 persona、Level 2 模板把温度压到审计表之后、
校正 agent 限一句话且用户可见文案全是工程腔硬编码——三源修复:
voice 置顶、直接回应开场、承接放宽 2-4 句、文案集中重写加防回归词表。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155nFCgCHtoA7jhSDGmZmMu
2026-09-01 15:27:52 +00:00
Jesse_Chen ff97de5ec4 docs(consult): add birth-time accuracy truth-passing task brief
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
用户自报精确时间仍被当作'未校正按范围交互'的三重根因:前端不传
declared_accuracy/time_source、引擎默认降到 5min 且档位缺失、
mastra 硬编码 not_auto_rectified。verified_chart 付费用户同样受害。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155nFCgCHtoA7jhSDGmZmMu
2026-09-01 15:24:20 +00:00
Jesse_Chen a6148af845 docs(chat): add contract-repairs and home-split batch-two task briefs
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
2026-09-01 15:08:26 +00:00
Jesse_Chen 54269fcfcc refactor(chat): extract home helpers, chart library, and starter surfaces
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
page.tsx still owns the chat main chain, but the first product surfaces now
live in their own modules so later splits can land without editing the 4k-line
Home. Source-lock tests follow the moved tokens; the orphan user-data contract
is aligned and added to the quick gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 22:58:02 +08:00
Jesse_Chen 8558900525 docs(chat): add home-split batch-one task brief
Independent Staging Quality Gate / validate (push) Successful in 13m7s
Independent Staging Quality Gate / publish (push) Successful in 50m57s
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
2026-09-01 13:47:24 +00:00
Jesse_Chen ce6a8a7e72 fix(chat): make cloud the only truth for charts, synastry, and pin/archive
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
Local fallbacks were creating fake saves and resurrecting deleted rows.
Pin and archive now live on chat_sessions so they follow the account.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 21:38:21 +08:00
Jesse_Chen 31c7b48261 docs(chat): add cloud-truth convergence task brief
Independent Staging Quality Gate / validate (push) Successful in 33m12s
Independent Staging Quality Gate / publish (push) Has been cancelled
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
2026-09-01 12:55:33 +00:00
Jesse_Chen 924f420202 fix(chat): keep the current session in the URL as ?c=
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
Refresh, back, and login return were dropping the open conversation because selection lived only in React state.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 20:42:21 +08:00
Jesse_Chen 48174a3cc5 docs(chat): add session URL routing task brief
Independent Staging Quality Gate / validate (push) Successful in 10m45s
Independent Staging Quality Gate / publish (push) Has been cancelled
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
2026-09-01 12:03:26 +00:00
Jesse_Chen b6989c3eea fix(chat): make the server the only writer of session messages
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
List GET no longer ships transcripts; consult appends questions after reserve and ignores client history so dual-tab last-write-wins cannot erase messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 19:51:19 +08:00
Jesse_Chen b98777aa5c Merge PR #47: close round A/2 tail gaps (tests, CI glob expansion, stale-score reuse)
Independent Staging Quality Gate / validate (push) Successful in 17m50s
Independent Staging Quality Gate / publish (push) Has been cancelled
Reviewed: gate pytest step verified locally with expanded argv (no shell);
env-only failures reproduced identically on pre-PR baseline; CI validate green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155nFCgCHtoA7jhSDGmZmMu
2026-09-01 11:30:13 +00:00
Jesse_Chen 901cdb96ef fix(rectification): expand quality-gate pytest globs before argv
Independent Staging Quality Gate / validate (pull_request) Successful in 13m37s
Independent Staging Quality Gate / publish (pull_request) Has been skipped
subprocess.run does not shell-expand tests/test_rectification_*.py, so a
string pin could stay green while the suite never ran. Expand glob targets
to real files and fail closed on zero matches.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 19:13:38 +08:00
Jesse_Chen c48a965640 fix(rectification): close round A/2 tail gaps in tests, CI, and stale-score reuse
Independent Staging Quality Gate / validate (pull_request) Failing after 6m13s
Independent Staging Quality Gate / publish (pull_request) Has been skipped
Window_scan assertions now match the public from_sign/to_sign contract, the
staging quick gate runs the rectification Python suite, and compare-candidates
rescores when stored policy lags the live engine identity.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 18:17:33 +08:00
Jesse_Chen 87fdd5648a docs(chat): add server-authoritative message task brief
Independent Staging Quality Gate / validate (push) Successful in 10m33s
Independent Staging Quality Gate / publish (push) Successful in 11m47s
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
2026-09-01 10:11:53 +00:00
Jesse_Chen 26ea3f06cb docs(rectification): add round A/2 tail-work task brief
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
存量断言修复(window_scan from_sign/to_sign)、CI 漏跑 Python 测试
排查补跑、真实环境点测单、存量快照按新引擎重算的触达方案。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155nFCgCHtoA7jhSDGmZmMu
2026-09-01 09:58:06 +00:00
Jesse_Chen 8743dcb105 fix(rectification): separate adjacent minutes with transition proximity
Independent Staging Quality Gate / validate (push) Successful in 11m56s
Independent Staging Quality Gate / publish (push) Has been cancelled
Day-level events now score Vimshottari/Narayana transition closeness so
nearby candidate minutes can diverge, with gated quality probes and
answer-prior ranking so high-base-rate existence questions stay out.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 17:41:06 +08:00
Jesse_Chen 20df8c6022 fix(rectification): let engine-ready cases adopt a representative minute
Independent Staging Quality Gate / validate (push) Successful in 10m34s
Independent Staging Quality Gate / publish (push) Successful in 13m34s
deliveryCapability no longer ties adoption to minute separation or holdout;
those stay on the exact-minute confirmation gate so users can save a range.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 16:52:01 +08:00
Jesse_Chen de84f06940 docs(rectification): add round-2 engine convergence task brief
Independent Staging Quality Gate / validate (push) Successful in 10m2s
Independent Staging Quality Gate / publish (push) Failing after 11m19s
相邻分钟可区分:换运日期贴近度打分(P0)、known_event_quality
受门控升级为区分题、基础率校正的期望信息增益、簇内不可分时
的前瞻验证登记。依赖 Round A(provisional-adopt)先行合入。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155nFCgCHtoA7jhSDGmZmMu
2026-09-01 08:17:39 +00:00
Jesse_Chen 422fc65b22 docs(rectification): add provisional-adopt task brief
Independent Staging Quality Gate / validate (push) Successful in 15m33s
Independent Staging Quality Gate / publish (push) Has been cancelled
采用门对齐引擎语义:provisional 采用成为一等成功出口。
记录三权威冲突根因、经授权推翻的旧红线、以及本地 1993
分钟级收敛系答案泄漏(不构成 web 端目标)的核查结论。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155nFCgCHtoA7jhSDGmZmMu
2026-09-01 08:01:25 +00:00
Jesse_Chen 75fc456d7e fix(rectification): drop duplicate collect cards and false run_failed
Independent Staging Quality Gate / validate (push) Successful in 10m23s
Independent Staging Quality Gate / publish (push) Failing after 8m59s
Spoken collect no longer renders a second visual prompt; choice legends stay screen-reader only and live cards share the assistant inset. Exhaustion collect avoids colliding with the opening question id, and a successful billed turn no longer surfaces run_failed after the exit gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 15:19:00 +08:00
Jesse_Chen e404b6f42b fix(rectification): guarantee nonterminal turn exits
Independent Staging Quality Gate / validate (push) Successful in 13m25s
Independent Staging Quality Gate / publish (push) Successful in 9m26s
2026-09-01 13:35:51 +08:00
Jesse_Chen 15877069fc docs(rectification): add non-terminal exit task brief
Independent Staging Quality Gate / validate (push) Successful in 13m36s
Independent Staging Quality Gate / publish (push) Successful in 10m51s
The previous pass closed the "adoptable on one event" hole but left no
forward path: case 645ba774 ends with can_adopt false and
current_question null, so the user is stuck with neither a result nor a
next question. Two causes: answer_choice never reaches
ensureNonTerminalTurnExit or persistNextInterviewIfIdle, all of whose
call sites sit in the message/opening branches; and once every probe is
answered or dropped, decideRectification returns offer_provisional_range
before the holdout branch, ignoring unused oos_blind prompts and the
nakshatra boundary question.

Same defect class as BUG-456, which was fixed by patching one branch
rather than gating every exit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
2026-08-31 19:18:25 +00:00
Jesse_Chen 857f9dc9b9 docs(rectification): record skill bump identity pitfalls
Independent Staging Quality Gate / validate (push) Successful in 15m49s
Independent Staging Quality Gate / publish (push) Successful in 10m28s
The registry packagePath points at versions/<version>/, but the root
SKILL.md copy makes it easy to hash the package root instead. Hashing
the root pulls the entire versions/ subtree into the digest and still
returns a value, so the mistake surfaces only as a failing gate later.
Records BUG-459 and corrects the task brief's D-2 table, which listed
the root SKILL.md as the hash target.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
2026-08-31 18:25:32 +00:00
Jesse_Chen 4b1331776d fix(rectification): fail closed UI and question ownership
Independent Staging Quality Gate / validate (push) Successful in 12m32s
Independent Staging Quality Gate / publish (push) Has been cancelled
2026-09-01 02:06:53 +08:00
Jesse_Chen 9f011194f2 fix(rectification): centralize delivery authority
Independent Staging Quality Gate / validate (push) Successful in 13m0s
Independent Staging Quality Gate / publish (push) Successful in 10m58s
2026-09-01 01:13:04 +08:00
Jesse_Chen 9aebd0474a docs(rectification): add decision-authority refactor task brief
Independent Staging Quality Gate / validate (push) Successful in 36m36s
Independent Staging Quality Gate / publish (push) Failing after 15m31s
The engine receipt says acceptance_allowed/selection_allowed false with
reasons insufficient_events and insufficient_domain_diversity, yet the
top-level projection flips both to true and renders adoptable candidates
after a single piece of evidence. Records the four structural causes:
dual decision authority where overlayPublicDecision lets TS override the
engine, insufficient-evidence sharing an exit with exhausted, capability
flags hardcoded across eleven branches, and several fail-open paths
including holdout "unavailable" granting adoption.

Also folds in the skill bump (D-2) after verifying that existing cases
bind their own skill_version and deprecated packages still resolve, so
no case migration is required.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
2026-08-31 14:37:26 +00:00
Jesse_Chen 67101f0397 test(billing): make renewal timing deterministic
Independent Staging Quality Gate / validate (push) Successful in 14m5s
Independent Staging Quality Gate / publish (push) Successful in 48m2s
2026-08-31 20:49:59 +08:00
Jesse_Chen afb8305ca1 fix admin feature pricing visibility
Independent Staging Quality Gate / validate (push) Failing after 26m23s
Independent Staging Quality Gate / publish (push) Has been skipped
2026-08-31 19:57:08 +08:00
Jesse_Chen 47b4b06bfb fix(rectification): surface pricing failures and persist opening question
Independent Staging Quality Gate / validate (push) Successful in 12m42s
Independent Staging Quality Gate / publish (push) Successful in 22m34s
2026-08-31 15:16:23 +08:00
Jesse_Chen 29e331bc0d docs(rectification): add billing failure and question-slot task brief
Independent Staging Quality Gate / validate (push) Successful in 9m55s
Independent Staging Quality Gate / publish (push) Successful in 11m16s
Traces the staging run_failed on the first user message to a missing
feature_pricing row: the opening turn is free and skips reserve(), so
the first `message` action is the first request to hit
resolve_feature_pricing, which raises feature_pricing_missing and maps
to the generic run_failed fallback. Also records the independent
opening-turn defect that leaves current_question null.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
2026-08-31 06:05:50 +00:00
Jesse_Chen 9492bae15f docs: record round-1 audit and open round-2 brief
Independent Staging Quality Gate / validate (push) Successful in 10m5s
Independent Staging Quality Gate / publish (push) Successful in 9m32s
Verified both round-1 briefs against the code rather than the progress
notes. Billing 0/1/2/3/6 and rectification 0/1/2/3/6 are in and clean, and
neither the confirmation gate nor the sealed holdout was loosened.

Two gaps remain. Prompt caching only emits its marker for Anthropic, so on
a DeepSeek-class provider it buys observability and no cost reduction, and
the membership fair-use numbers are untouched — correctly so, since no
real unit cost has been measured yet. The round-2 brief gates those on a
staging measurement pass and pulls the per-answer narrowing table forward,
since it is the deliverable and depends on nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155nFCgCHtoA7jhSDGmZmMu
2026-08-31 05:00:55 +00:00
Jesse_Chen 3a4396a4b7 fix(rectification): adopt evidence-based stop semantics
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
2026-08-31 12:50:30 +08:00
Jesse_Chen f8aea88bc3 docs(rectification): archive session records and add delivery-gap tasks
Independent Staging Quality Gate / validate (push) Successful in 11m54s
Independent Staging Quality Gate / publish (push) Successful in 11m1s
Two real local sessions are archived. In them the agent states twice that
its minute came from a report already in the upstream repo rather than
from the user's answers, and the follow-up "fix" wired that answer into
the scoring chain; upstream now carries a Narayana tie-break derived from
that single case. This repo was checked and is clean, so two red lines now
keep it that way and gate any upstream sync.

The same records show what the answers genuinely bought: a 30-minute
window narrowed to 3. Tasks 7-10 add what makes that deliverable — the
per-answer narrowing table, an explain surface, mid-case window changes
with evidence retained, and the batched first round.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155nFCgCHtoA7jhSDGmZmMu
2026-08-31 03:05:11 +00:00
Jesse_Chen 6abe2a5899 test: sync capability audit route contract
Independent Staging Quality Gate / validate (push) Successful in 10m27s
Independent Staging Quality Gate / publish (push) Successful in 8m59s
2026-08-31 10:36:38 +08:00
Jesse_Chen 30ef6afea7 docs(rectification): archive upstream playbook and add stop-rule task
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled
The upstream interview playbook and evidence thresholds resolve task 0.
Upstream stops and reports when evidence is thin — fewer than three dated
events, fewer than two domains, or a tie — while this repo treats the same
kind of thresholds as a confirmation gate and keeps asking when they are
not met. Its label ladder has no confirmed rung at all, and every contract
test asserts candidate_range_not_birth_time_truth.

Task 1 capped the interview by round count, which is half of it. Task 6
adds the evidence-state stop rules, reframes exhausted as a normal
delivery, adopts the upstream label ladder and closing wording, and keeps
the 4/3 confirmation gate separate from the 3/2 delivery floor.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155nFCgCHtoA7jhSDGmZmMu
2026-08-31 02:27:32 +00:00
Jesse_Chen 53450f5bf3 Merge remote-tracking branch 'origin/staging' into codex/billing-pricing-20260830
Independent Staging Quality Gate / validate (push) Failing after 8m27s
Independent Staging Quality Gate / publish (push) Has been skipped
2026-08-31 10:00:36 +08:00
Jesse_Chen aafcef06df docs(billing): define membership fair-use semantics 2026-08-31 10:00:03 +08:00
Jesse_Chen 3a762e1fca feat(billing): record prompt cache usage 2026-08-31 09:59:53 +08:00
Jesse_Chen e8bd3a5208 feat(rectification): expose candidate result reports
Independent Staging Quality Gate / validate (push) Successful in 16m46s
Independent Staging Quality Gate / publish (push) Successful in 19m37s
2026-08-31 05:52:38 +08:00
Jesse_Chen 6cbf1f22e2 fix(rectification): separate question slots from model prose 2026-08-31 05:50:28 +08:00
Jesse_Chen 86ba17ee18 fix(rectification): enforce persisted convergence budgets 2026-08-31 05:50:17 +08:00
Jesse_Chen 79304c31fc fix(rectification): keep model confirmations separate from question slots 2026-08-31 04:50:39 +08:00
Jesse_Chen a499c3444e feat(admin): add read-only pricing simulator 2026-08-31 04:30:40 +08:00
Jesse_Chen 6e13949d3b feat(billing): resolve chat and rectification pricing by feature 2026-08-31 04:29:45 +08:00
Jesse_Chen 8edae211ff test(billing): cover durable report settlement 2026-08-31 04:29:38 +08:00
Jesse_Chen a73d996f65 feat(billing): charge personal reports with durable settlement 2026-08-31 04:08:20 +08:00