Commit Graph
213 Commits
Author SHA1 Message Date
ClaudeandClaude Opus 5.5 39e0ef8af2 feat(rectification): 生时纠正 marked 「随缘版」, every step recorded (adopted or not) in chart_choice_steps for later checking, the stale 「开头会说明是你选的」 line removed, privacy policy says so (BUG-2256)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
2026-11-23 15:36:44 +08:00
ClaudeandClaude Opus 5.5 ebe22533c8 fix(codes): a single code reused by its own redeemer still counts as a failed attempt; the legacy-code test asserts the balance after redemption
Gate 8375: database-redeem-security expected the old attempt count, and
database-redeem-code-kinds-330 assumed a zero starting balance. The migration
has not run anywhere yet, so it is edited in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-22 18:04:31 +08:00
ClaudeandClaude Opus 5.5 f343a4ea1c fix(codes): the old redeem_code entry point keeps already_redeemed for a reused single code (#330)
Independent Staging Quality Gate / validate-python (push) Failing after 9m10s
Independent Staging Quality Gate / validate-frontend (push) Failing after 11m54s
Independent Staging Quality Gate / publish (push) Skipped
redeem_code_v2 reports a reused single code by the same user as
already_redeemed_by_you; the legacy wrapper maps it back so the existing
redeem-security contract (and its CI database test) is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-22 17:13:20 +08:00
ClaudeandClaude Opus 5.5 c095407fae feat(codes): redeem codes come in three kinds, carry their own success celebration, and lose the fixed prefix (#330)
Owner 2026-11-22. 活动码 (campaign): one code, many users, each once, optional
start time, end time and total cap, custom text or random. 个人码: one random
code, one redemption. 批量码: N single codes sharing a batch name, CSV right
after generation. Every code may set a success title, message and one of four
drawn celebrations (default / stars / moon / gift) shown in the approved
success dialog; failures stay toasts.

Random codes drop the JYOTISH- prefix: XXXX-XXXX from an alphabet without
0 O 1 I L, crypto randomness, hashed after normalisation (upper case, no
spaces or dashes). Old JYOTISH codes keep their exact-text hash and still
redeem: redeem_code_v2 tries the exact hash, then the normalised one.

Migration 20261122140000 is additive: kind / batch / campaign / window / cap /
count / success columns, redemption_code_uses(code_id, user_id unique) as the
once-per-user record (kept on account deletion), the ledger's per-code unique
moved to that table, the code-row lock serialising a capped campaign.
redeem_code(text) keeps its signature and result and wraps v2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-22 17:12:54 +08:00
ClaudeandClaude Opus 5.5 7ffd9fd8c6 feat(release-notes): admin writes 「更新说明」; each published version shows once per user; settings lists them (#331)
- Migration 20261122130000_release_notes.sql: release_notes (version, title,
  grouped items, draft/published/withdrawn) and release_note_reads; RLS on,
  no table privilege for app/service roles; users go through service-role
  functions list_release_notes_for_user / mark_release_note_read (a version
  published before the account existed counts as seen); the admin writes
  through audited admin_save_release_note / admin_set_release_note_status
  gated by the new content.release_notes.write (owner, operations,
  content_editor) and reads via an admin_runtime select policy.
- APIs: GET/POST /api/release-notes (signed-in user only) and GET/POST
  /api/admin/release-notes.
- Admin page 更新说明: table + editor drawer with 新功能/修复/改进 lists and a
  live preview; 保存草稿 / 发布 / 撤回.
- User side: 「本次更新」 dialog once per version (知道了 records the read);
  settings gets an 更新说明 pane (phone segmented nav becomes four).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-22 17:12:54 +08:00
ClaudeandClaude Opus 5.5 d461c59618 fix(birth): overseas birth places save everywhere; the chart panel refreshes after onboarding saves; place labels never show the stored dots (BUG-2167)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2Vp62Ur3C7yRWQdSq
2026-11-22 14:32:09 +08:00
ClaudeandClaude Opus 5.5 161e03ad97 feat(birth): optional precise latitude/longitude under the birth place, with its source shown on the chart page and in the report (BUG-2125)
Independent Staging Quality Gate / validate-python (push) Successful in 10m11s
Independent Staging Quality Gate / validate-frontend (push) Failing after 11m32s
Independent Staging Quality Gate / publish (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2Vp62Ur3C7yRWQdSq
2026-11-21 23:03:14 +08:00
ClaudeandClaude Opus 5.5 fd995f4f63 feat(admin): each personal report's reading repair record is readable in the admin backend (BUG-2120)
Independent Staging Quality Gate / validate-frontend (push) Successful in 6m22s
Independent Staging Quality Gate / validate-python (push) Failing after 7m34s
Independent Staging Quality Gate / publish (push) Skipped
A security-definer function, gated by support.quality.read and granted to
admin_runtime only, returns per report the reading's section statuses and
the transform log without any reading text; the admin page 报告写作记录
lists sections, reasons, repair, salvage and fallback per report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-21 13:02:32 +08:00
ClaudeandClaude Fable 5.2 933ab1d96e feat(annual): questions are asked beside the annual report, about a section or a selected passage (BUG-2085)
Independent Staging Quality Gate / publish (push) Canceled after 0s
Independent Staging Quality Gate / validate-frontend (push) Canceled after 21s
Independent Staging Quality Gate / validate-python (push) Canceled after 26s
An annual report's questions live in a consultation conversation bound to
the report by chat_sessions.report_id (one per report, guarded by a
trigger); no settlement function is redefined. The consult route hands
every turn of such a conversation to the annual handler, which reads only
the saved report, checks dates and placements against what it read, and
settles the fixed sentence and feedback-only turns free. The page has an
entry per written section, a page-level entry in the title bar, passage
selection and the shared panel or bottom sheet.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-20 16:53:17 +08:00
ClaudeandClaude Opus 5.5 1a98e29e61 fix(rectification): saving the stated minute keeps its seconds; a seconds-only edit keeps someone else's adopted time (BUG-2074)
Independent Staging Quality Gate / validate-frontend (push) Successful in 6m12s
Independent Staging Quality Gate / validate-python (push) Successful in 7m30s
Independent Staging Quality Gate / publish (push) Canceled after 23s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
2026-11-20 13:33:29 +08:00
ClaudeandClaude Fable 5.2 14d5c34b6d feat(birth): the stated birth time takes optional seconds; saving keeps them; someone else's chart may change seconds within its minute (BUG-2067 step 2)
Independent Staging Quality Gate / validate-frontend (push) Successful in 5m45s
Independent Staging Quality Gate / validate-python (push) Successful in 7m9s
Independent Staging Quality Gate / publish (push) Canceled after 2m32s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2Vp62Ur3C7yRWQdSq
2026-11-20 13:10:23 +08:00
ClaudeandClaude Fable 5.2 21ff01b283 feat(account): top-up admin switch, faster 账户与点数, user credit ledger API, avatar upload server side (BUG-2057)
- 「充值」 is an admin switch (billing.purchase on the 功能开关 page, off until
  turned on, existing permission and audit). Open = switch on and gateway
  usable; the answer rides on the account payload as paymentOpen. Closed: no
  packages request, no purchase tabs, empty product list, orders refused.
- The billing panel chunk is prefetched while idle and when a settings
  section opens; the packages route reads its three inputs in one round; a
  same-height line holds the place while the list is unknown.
- GET /api/account/credit-ledger: the caller's own rows (read as the user,
  filtered by the session id), 20 per page with a cursor, all/in/out/redeem,
  reader names only, free turns hidden, links only to owned reports/sessions.
- Avatar upload server side: PUT/GET/DELETE /api/account/avatar/image, JPEG
  or WebP, square up to 256, 200 KB, type and size read from the bytes,
  rate-limited; stored in profile_avatar_images (owner-only RLS, migration
  20261120100000); account payload carries only avatarImage.version.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-20 10:48:03 +08:00
ClaudeandClaude Opus 5.5 533cc5b0e5 fix: a free smalltalk reply may carry the birth input revision, so it saves again (BUG-2040)
Independent Staging Quality Gate / validate-frontend (push) Successful in 5m32s
Independent Staging Quality Gate / validate-python (push) Successful in 7m2s
Independent Staging Quality Gate / publish (push) Successful in 3m40s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
2026-11-19 20:42:49 +08:00
ClaudeandClaude Opus 5.5 66e4db331e fix: a feedback-only reply in the synastry report chat settles free too (BUG-1986 follow-up)
Independent Staging Quality Gate / validate-frontend (push) Failing after 3m55s
Independent Staging Quality Gate / validate-python (push) Successful in 7m36s
Independent Staging Quality Gate / publish (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
2026-11-18 18:37:22 +08:00
ClaudeandClaude Opus 5.5 a26f990557 feat: readings see only the split-out question and answers written from it; feedback-only turns restate the last reading (BUG-1980)
Independent Staging Quality Gate / validate-frontend (push) Successful in 5m45s
Independent Staging Quality Gate / validate-python (push) Successful in 7m13s
Independent Staging Quality Gate / publish (push) Successful in 3m21s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
2026-11-18 15:10:43 +08:00
ClaudeandClaude Fable 5.2 9fb924931d merge: staging into self-selected scenario (BUG-1958)
Independent Staging Quality Gate / validate-python (pull_request) Successful in 8m11s
Independent Staging Quality Gate / validate-frontend (pull_request) Successful in 9m9s
Independent Staging Quality Gate / publish (pull_request) Skipped
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
2026-11-17 14:46:11 +08:00
ClaudeandClaude Fable 5.2 a7ab0102ae feat: 常用问题 is edited and published in the admin; content_editor role for the astrologer
Independent Staging Quality Gate / validate-frontend (push) Successful in 6m23s
Independent Staging Quality Gate / validate-python (push) Successful in 9m20s
Independent Staging Quality Gate / publish (push) Successful in 4m1s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2Vp62Ur3C7yRWQdSq
2026-11-17 14:33:43 +08:00
jesse-ux df52b7fe72 test: verify scenario saves and explain chart evidence 2026-11-17 14:08:02 +08:00
jesse-ux ebf6dd4ee0 fix: preserve chosen birth scenarios without confirming the time 2026-11-17 13:59:05 +08:00
ClaudeandClaude Fable 5.2 a814661ddb fix: admin role could not read usage tables behind row-level security (BUG-1935)
Independent Staging Quality Gate / validate-frontend (push) Successful in 5m32s
Independent Staging Quality Gate / validate-python (push) Successful in 6m54s
Independent Staging Quality Gate / publish (push) Successful in 3m8s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2Vp62Ur3C7yRWQdSq
2026-11-16 16:18:09 +08:00
ClaudeandClaude Fable 5.2 6a5475ad37 feat(db): a model provider can hold several API keys
New table public.model_provider_keys (label, encrypted key, enabled,
optional concurrency limit). The migration copies each provider's
existing key into one row labelled 默认 and keeps
model_providers.encrypted_api_key as a mirror of the first enabled key,
so an older web image, the publish and rollback checks and the
connection-test hash keep working. Writes go through security-definer
functions gated by models.write and audited without key material; the
last enabled key of an enabled provider cannot be disabled or deleted.
admin_runtime gets the SELECT grant together with its SELECT policy
(BUG-147).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2Vp62Ur3C7yRWQdSq
2026-11-16 10:19:03 +08:00
jesse-ux 490a0b61fd Use the ten-section synastry reader contract (#281)
Independent Staging Quality Gate / validate-python (pull_request) Successful in 9m52s
Independent Staging Quality Gate / validate-frontend (pull_request) Failing after 23m41s
Independent Staging Quality Gate / publish (pull_request) Skipped
2026-11-15 14:07:25 +08:00
jesse-ux 6ebf490b06 Allow adaptive adoption sources in the chart choice writer
Independent Staging Quality Gate / validate-python (pull_request) Successful in 6m39s
Independent Staging Quality Gate / validate-frontend (pull_request) Successful in 7m15s
Independent Staging Quality Gate / publish (pull_request) Skipped
Independent Staging Quality Gate / validate-frontend (push) Successful in 5m13s
Independent Staging Quality Gate / validate-python (push) Successful in 6m37s
Independent Staging Quality Gate / publish (push) Successful in 2m43s
2026-11-14 07:12:30 +08:00
jesse-ux ace419b809 Implement multi-round chart choice and seconds adoption
Independent Staging Quality Gate / validate-python (pull_request) Successful in 8m14s
Independent Staging Quality Gate / validate-frontend (pull_request) Successful in 10m28s
Independent Staging Quality Gate / publish (pull_request) Skipped
Refs #238, BUG-1872
2026-11-13 13:00:55 +08:00
ClaudeandClaude Opus 5.5 228df0f7fb feat(ephemeris): personal month calendar on 星历 (BUG-1666, BUG-1667)
Independent Staging Quality Gate / validate-frontend (push) Successful in 5m12s
Independent Staging Quality Gate / validate-python (push) Successful in 5m48s
Independent Staging Quality Gate / publish (push) Successful in 3m27s
The 星历 page gets a month calendar for the chosen person: every day is
吉 / 平 / 凶 with two or three life themes from transits against their own
chart, the selected day opens to its themes and "为什么", and below it
「接下来要留心」, 「这几天」 and 「回看」 (owner, 2026-11-07: A's grid plus
C's lower half).

Engine: scripts/personal_calendar.py joins existing calculators on one
date axis (one call, <0.5 s for 45 days): Panchanga in the subject's own
ayanamsa, Tara / Chandra bala, Moon house from Lagna and Moon,
Ashtakavarga SAV + Moon BAV, transit conjunctions with natal points,
functional benefic / malefic, activity verdicts with native inputs,
ingress / station / combustion / eclipse / Vimshottari AD+PD boundaries,
and a month backdrop (Vimshottari MD/AD/PD, Narayana, Sade Sati / Kantaka,
slow-graha contacts, Jupiter+Saturn double transit). New endpoint
/api/personal_calendar.

BUG-1666: check_activity_muhurta ignored Vishti karana, Vyatipata /
Vaidhriti and an avoided Chandra bala, so a Vishti day could be 大吉.
BUG-1667 (closes BUG-703 / BUG-707): /api/panchanga_range now honours the
requested ayanamsa; the day view asks for the subject's own and drops the
Lahiri note.

Frontend: /api/ephemeris/month (own rate-limit bucket, cached),
/api/ephemeris/checks + migration 20261107010000_ephemeris_day_checks
(answers kept with the birth declaration they were made under). Copy is
life-first with the sky events folded under 为什么; draft wording pending
the astrologer. TASK-ephemeris-page decisions 4/6 and hard lines 3/7/9
superseded per the owner; DESIGN.md §16 updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXozbkyFNqbu8pVEtZ7W
2026-11-07 00:44:37 +08:00
ClaudeandClaude Opus 5.5 3a6f09815d feat(rectification): history, current result first, mini charts, all cards open (BUG-1654)
Every save keeps a record (chart_choice_records via chart_choice_adopt_v3);
the page opens on the current result with its time scale and the history
list, a past record can be adopted again while the birth declaration is
unchanged. Comparison cards are all open with a 60px mini chart per side
following the north/south board setting. Saving shows one toast.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXozbkyFNqbu8pVEtZ7W
2026-11-06 15:58:19 +08:00
ClaudeandClaude Opus 5.5 ba6aa2413b fix(rectification): ask for a range only when the profile has none, and save it back (BUG-1649)
Old 0/0 profiles show no range in the form instead of 最早 = 最晚. The page's
range question uses an even 2x2 grid with parallel labels; saving writes the
picked range to the declaration and adopts the minute in one transaction
(chart_choice_adopt_v2). A ±60 min range is compared without narrowing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXozbkyFNqbu8pVEtZ7W
2026-11-06 13:36:32 +08:00
ClaudeandClaude Opus 5.5 97afd1716a feat: chart choice replaces event-scored rectification page
Event scoring was measured at chance level on the 77 Rodden-AA holdout
cases (BUG-1091). The new flow finds the dividing line nearest the reported
time, describes how the flipped divisional charts read on either side, asks
up to five self-assessment questions, and saves the user's own choice
(provenance user_choice) with the domains to read in both versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXozbkyFNqbu8pVEtZ7W
2026-11-06 02:06:17 +08:00
ClaudeandClaude Opus 5.5 3d7efeafc1 fix(reports): typed lane claim is its own function, so the original claim is never overloaded
Independent Staging Quality Gate / validate-python (push) Successful in 6m38s
Independent Staging Quality Gate / validate-frontend (push) Successful in 6m44s
Independent Staging Quality Gate / publish (push) Successful in 3m7s
The staging DB gate replays 20260814040000 on top of the new migration;
with claim_personal_report_job overloaded by a defaulted fourth argument,
a three-argument call became ambiguous. The lane now calls
claim_personal_report_job_for_types and the original stays untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXozbkyFNqbu8pVEtZ7W
2026-11-06 00:09:51 +08:00
ClaudeandClaude Opus 5.5 efceab8a2a feat(reports): report queue lanes — two at once with a short-report lane, waiting screens show the expected wait
Independent Staging Quality Gate / validate-frontend (push) Failing after 4m38s
Independent Staging Quality Gate / validate-python (push) Successful in 6m35s
Independent Staging Quality Gate / publish (push) Skipped
Every report type already queued in personal_report_jobs, one at a time per
server. The worker now runs PERSONAL_REPORT_WORKER_CONCURRENCY lanes (default
2); the second takes only annual and synastry reports so they never wait
behind long personal reports. claim_personal_report_job gains an optional
report-type filter; personal_report_queue_view (owner-only, security definer)
gives the wait, shown as a single line on the annual, personal and synastry
waiting screens. Also keeps the privacy whitelist line numbers in
personal-report-api.test.ts unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXozbkyFNqbu8pVEtZ7W
2026-11-05 23:41:31 +08:00
ClaudeandClaude Opus 5.5 f00ddf2c4e feat(intake): six birth-time sources with a user-given range (issue #144 part 1)
- Intake: six verbatim options (出生证明 / 户口本 / 家人记得 / 只记得时辰 /
  只知道时段 / 完全不知道). Clock-time sources take an earliest / latest or
  「不清楚误差」; no source maps to a fixed error any more. Twelve 时辰
  picker (子时 23:00–00:59 from the filled date); the position answer is a
  clue and never narrows the window.
- Validation: drop the hospital 2/2 and family 15/30/60/120 rules; a time
  needs a containing range (minutes derived, may be uneven) or
  uncertainty_known=false. Older 2/2 and 15–120 profiles still resave as is.
- Lagna precheck: uses the given range; without one it scans only the
  stated minute and says the verbatim T4 line; ranges read as clocks.
- Migration 20261102020000 (additive): birth_time_source accepts
  id_document; profiles and chart_profiles gain birth_time_record_kind,
  birth_time_uncertainty_known, birth_time_shichen; chart_profiles gains
  birth_time_clue; sync trigger and backfill carry them.
- BUG-1513: readProfile now reads the camelCase library record of other
  people (source, stated time, window, status).
- BUG-1514: chart_profiles sync trigger is security definer, so a person
  without a clock time can be saved by the people route.
- id_document reaches the frozen engine contract as approximate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y
2026-11-02 23:39:15 +08:00
ClaudeandClaude Opus 5.5 6721d320d8 fix(reports): release credits when lease recovery fails a report (BUG-1505)
recover_expired_personal_report_jobs now releases the reservation (by the
report's request_id, idempotent with the worker and the delete trigger)
before it fails a job; a release that raises or errors leaves that row
running for the next sweep and logs errorCode=report_refund_failed.
Migration 20261102010000_report_lease_expiry_release.sql replaces only the
function (invoker, empty search_path, service_role only).

The report worker no longer closes a failed job when its refund fails: it
logs report_refund_failed and leaves the lease to the recovery sweep.
Rectification retries a failed release once with the same case request id
and logs rectification_refund_failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y
2026-11-02 01:06:19 +08:00
ClaudeandClaude Opus 5.5 9b1127c23c fix(rectification): v3 keeps no table access; a definer helper binds the case (BUG-1502)
Independent Staging Quality Gate / validate (push) Successful in 17m14s
Independent Staging Quality Gate / publish (push) Failing after 11m33s
Gate run 6343 refused the invoker v3 on agentic_rectification_cases: since
20260814010000 service_role has no direct rights on cases, every case write
goes through owner-held security-definer RPCs. v3 now only checks the person,
calls v2 and hands the case to agentic_rectification_bind_case_subject_v1,
a service_role-only security-definer function that locks the case, binds a new
case and its conversation to the person, and checks the person matches.
Migration parsed with pglast (58 statements, 17 PL/pgSQL bodies).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y
2026-11-01 21:56:59 +08:00
ClaudeandClaude Opus 5.5 ac83eb0df0 fix(rectification): v3 opens cases as the invoker so it can call v2 (BUG-1502)
Independent Staging Quality Gate / validate (push) Failing after 16m45s
Independent Staging Quality Gate / publish (push) Skipped
The staging gate's real-database tests refused open_agentic_rectification_case_v3:
it was security definer, and 20260814010000 revokes EXECUTE on the 11-argument
v2 even from its owner, leaving service_role alone. v3 is now security invoker,
like the 12-argument v2; reading the person and labelling the chat session move
into two service_role-only security-definer helpers, because service_role has
no rights on chart_profiles or chat_sessions. The migration has never run, so it
is corrected in place.

Also adds the annual.full price rows to the whole-table pricing assertion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y
2026-11-01 21:37:48 +08:00
Claude 5b566af981 Merge annual report generation and entry overlay (#153, #154)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y

# Conflicts:
#	CHANGELOG.md
2026-11-01 20:20:47 +08:00
ClaudeandClaude Opus 5.5 4972fa40a6 feat(annual): annual report generation and annual.full billing (#153)
New report type annual_full on the personal report queue, like
synastry_full. POST /api/reports {reportType: annual_full} reserves
annual.full (20 credits by default, admin-editable), stores the range
and the optional situation, and queues the job; a year already written
for the same subject opens directly without a second charge. The worker
asks /api/annual/report_facts for the server cards, writes the sections
one at a time (person, overview, domains, windows, remaining, close)
with a program gate and one rewrite, saves the snapshot after every
section, then settles; a failure releases the reservation.
GET /api/annual/overview serves the overlay from the slim package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y
2026-11-01 20:15:45 +08:00
ClaudeandClaude Opus 5.5 ee08562471 feat(rectification): rectify other people in the profile list (issue #160)
Product 2026-11-01: 1A 2A.
- Cases record whose chart (chart_profile_id, null = owner); add-only
  migration 20261101010000_rectification_chart_subject.sql, old cases stay
  the owner's.
- Adoption / confirmation / segment adoption / VedAstro refresh read and
  write that person's row through two helpers; the owner's profile and
  cases are untouched. Owner edits rebaseline only owner cases, person
  edits only that person's; a new declaration drops the adopted minute.
- Open cases are counted per person (entry summary v2, in-chat offer,
  resume lookup); open_agentic_rectification_case_v3 binds a new case and
  its conversation to the person.
- delete_chart_subject deletes the person's cases and their
  conversations first (no refund).
- /rectification follows the current person (switcher beside the title),
  shows name and relation; self-only limits removed (hook, chat offer,
  chart ascendant link, starter hint).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y
2026-11-01 17:26:04 +08:00
jesseandClaude Opus 5.5 dfd3208979 feat: standalone rectification entry at /rectification (issue #145)
Independent Staging Quality Gate / validate (push) Failing after 13m25s
Independent Staging Quality Gate / publish (push) Skipped
- Sidebar 「生时校正」 under 星盘, behind a new account `rectification` flag.
- /rectification page: status card from entry-summary (not started / in
  progress with window and confirmed event count / adopted time), a short
  data check, then the home rectification surface (?rectify=1, or
  ?rectify=new to start over; ?c=<id> to continue or view). No price on
  the page.
- entry-summary gains session id, candidate range, confirmed evidence count
  and adopted times (add-only migration 20261028170000).
- The offer card under a consultation answer becomes one line and a link
  to /rectification; an explicit request in chat also goes there. No case
  is opened from a conversation any more.
- Starter home shows a rectification prompt for self charts with an
  estimated time; onboarding checklist gains 做一次生时校正 for them.
- Chart-page link points to /rectification. Shell registers its router so
  home hooks can navigate client-side without useRouter in Home().
- Docs: VOICE, DESIGN, CHANGELOG, device checklist.

Self profile only; other people are issue #160.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 16:50:55 +08:00
jesse-uxandGrok (agent loop) c6c69aa04b 拖动排序一次写完,新对话仍排在最上面(BUG-1449)。
Co-Authored-By: Grok (agent loop)
2026-10-27 00:03:59 +08:00
jesse-uxandGrok (agent loop) eee8564b7f 星盘档案可以拖动排序,合盘开始前先确认扣点。
Independent Staging Quality Gate / validate (push) Failing after 9m16s
Independent Staging Quality Gate / publish (push) Skipped
人物卡、菜单、编辑和删除换成组件库。chart_profiles 增加可空的 archive_order,本人始终排在第一。合盘选人页两个名字并排,开始按钮居中,点了先说出点数和余额。

自测:tsc 0;lint 0 error(122 警告,与上一张相同);定向测试通过;next build 后 / 仍是 Static;首页 JS gzip-9 639609,相对 640131 少 0.08%。test:db 79 通过、13 失败,失败名单与 windows-known-failures.txt 一致,排序列断言在通过的那一组。没有浏览器登录态。

Co-Authored-By: Grok (agent loop)
2026-10-25 05:05:00 +08:00
jesse-uxandGrok (agent loop) 352d45b2ef 外壳换成组件库:侧栏可拖宽,会话可排序(#105)。
Independent Staging Quality Gate / validate (push) Failing after 9m12s
Independent Staging Quality Gate / publish (push) Skipped
桌面侧栏可在 200 到 360 像素之间拖宽,拖到最左收起,宽度记在本机。手机从左边滑出。会话在同一组里拖动排序,顺序写入可空的 sidebar_order,收藏仍置顶。账户菜单、设置、反馈和退出确认改用组件库。顶栏点数只显示图标和数字。启程清单还在。菜单、拖宽、拖动排序和翻页在首屏之后再载入。

自测:tsc 退出码 0;npm run lint 0 error、121 warning;改到的前端测试 205 项全过;npm run build 后首页仍是 static;首屏 gzip 630350,相对 8f7c0f7d 的 621226 为 +1.47%。test:db 92 项里 79 过、13 败,失败名与 Windows 已知清单一致,排序列在通过的 ok 37。没有跑全量 npm test,没有跑 Python 快速门。没有登录态,没有在浏览器里拖侧栏。

Co-Authored-By: Grok (agent loop)
2026-10-25 01:41:19 +08:00
jesse-uxandGrok (agent loop) fdd592d3f3 feat: 新账户首问免费,档案可标明关系
只做启程(一):同一笔预扣覆盖已公布的标准档,更贵的只扣差价;引导状态与人物关系只加列。tsc 与 lint 通过。test:db 91 项,失败 14,其中 13 条为 Windows 已知失败;校正遥测单独重跑通过。

Co-Authored-By: Grok (agent loop)
2026-10-23 00:34:28 +08:00
jesse-uxGrok (agent loop)Cursor
57ee79cc5f fix(synastry): let the same pair start another report
A finished match used to reopen the old report. Starting again now writes a new one and charges again; a report still being written is reused.

Co-Authored-By: Grok (agent loop)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-21 23:08:21 +08:00
jesse-uxandCursor 0a5d93ab75 fix(admin): save published models as a new draft and allow deleting them
Independent Staging Quality Gate / validate (push) Successful in 14m0s
Independent Staging Quality Gate / publish (push) Successful in 4m5s
Editing a published model tried to update a non-draft row, so the save collapsed into a generic constraint error.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-20 15:02:42 +08:00
jesse-uxandCursor 006b067e82 fix(synastry): open the match page from the live flag and price it at 19 credits
Independent Staging Quality Gate / validate (push) Failing after 14m48s
Independent Staging Quality Gate / publish (push) Skipped
The closed sentence was prerendered when the build had no database. The page now asks for the flag in the browser, and synastry.full is published at 19 credits.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-20 12:52:28 +08:00
jesse-uxandCursor 3956519f33 feat(synastry): open a follow-up chat from one stored report section
The chat stays bound to that section's saved calculation, checks each chart fact before answering, and bills like an ordinary turn.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-19 21:44:25 +08:00
jesse-uxGrok (agent loop)Cursor
9ea5b3b0c0 feat(synastry): write the full relationship report on demand
The pair page and reader replace the leftover chat draft, and the same pair is not charged again.

Co-Authored-By: Grok (agent loop)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-19 10:03:55 +08:00
jesse-uxGrok (agent loop)Cursor
52160a9cef merge origin/staging into marriage-match fix
Keep both changelog entries and the archive-limit board row. The marriage-match row stays on this branch for the storage fix.

Co-Authored-By: Grok (agent loop)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-18 18:51:34 +08:00
jesse-uxGrok (agent loop)Cursor
cf063834ca feat(synastry): store the upstream seven-item marriage match
Move the bde5d615 engine and full-synastry skill in unchanged, save both profiles without billing or a page, and retire the old synastry module.

Checked targeted pytest, tsc 0, lint 0 errors, service tests 6/6, and test:db 73 pass / 13 fail matching the Windows known list.

Co-Authored-By: Grok (agent loop)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-18 16:44:05 +08:00
jesse-uxandCursor a0e84845e9 feat(people): raise the chart archive cap to 20 people
Independent Staging Quality Gate / validate (push) Successful in 17m28s
Independent Staging Quality Gate / publish (push) Successful in 23m1s
The trigger, the shared constants, and the limit sentence now agree, and the archive and person menus scroll instead of growing past the screen.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-18 16:33:06 +08:00