feat: explainable longitudinal pattern summaries with cited records (#34) #76
Closed
rockachopa
wants to merge 0 commits from
timmy/34-explainable-pattern-summaries into main
pull from: timmy/34-explainable-pattern-summaries
merge into: stackchain:main
stackchain:main
stackchain:timmy/19-metrics-operator-report
stackchain:timmy/16-image-ingress-hardening
stackchain:timmy/40-security-rc-evidence
stackchain:timmy/27-dataset-card
stackchain:timmy/26-review-adjudication
stackchain:timmy/32-abstention-policy
stackchain:timmy/29-evaluation-harness
stackchain:timmy/35-portable-backup-versions
stackchain:timmy/24-training-contribution-consent
stackchain:fix/demo-caption-pixels
stackchain:timmy/36-photo-lifecycle-controls
stackchain:timmy/release-notes-grounded-chat
stackchain:timmy/37-grounded-chat-citations
stackchain:timmy/21-escalation-regression
stackchain:timmy/15-container-worker-receipts
stackchain:timmy/73-blank-first-ordering
stackchain:timmy/18-vision-corpus
stackchain:timmy/20-photo-dataflow-threat-model
stackchain:timmy/67-hard-stool-followup
stackchain:timmy/13-provisional-suggestion-state
stackchain:timmy/12-manual-fallback-draft-recovery
stackchain:timmy/11-mobile-capture-recovery
stackchain:free/hy3-timmy-16
stackchain:timmy/35-version-ledger-migrations
stackchain:timmy/41-release-observability-dashboard
stackchain:free/step-timmy-14
stackchain:timmy/21-escalation-regression-suite
stackchain:timmy/17-bounded-inference-queue
stackchain:timmy/58-strict-csp-runtime-config
stackchain:timmy/55-staging-deployment-tooling
stackchain:timmy/53-private-subpage-staging
stackchain:timmy/10-reproducible-smolvlm-bootstrap
stackchain:timmy/48-vomiting-phrase-hotfix
stackchain:timmy/48-server-safety-override
stackchain:timmy/47-sleek-hermes-agent
stackchain:timmy/9-product-boundary-decisions
stackchain:timmy/8-ci-gates
No Reviewers
Labels
Clear labels
area/backend
area/data
area/frontend
area/model
area/privacy
area/release
area/safety
blocked
human-gate
priority/P0
priority/P1
priority/P2
state:review
type/docs
type/epic
type/feature
type/ops
type/research
type/security
type/test
Application API and storage
Dataset and provenance
PWA and interaction design
Vision model and inference
Privacy and consent
Release engineering and distribution
Clinical safety boundary
Blocked on an explicit dependency or decision
Requires explicit human approval
Release-critical
High priority
Planned
Documentation and evidence
Roadmap epic
Product feature
Infrastructure and operations
Research or evaluation
Security hardening
Verification and quality gate
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stackchain/timmy-talking-turd#76
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #34
What changed
The home "Timmy noticed" line was a single assertive sentence. It is now an explainable summary:
src/summary.jsbuilds a windowed (last 28 days) summary from confirmed ledger records only.Every statement carries the
entryIdsit was built from: a frequency line plus one line per Bristolgrouping present in the window.
insufficient: true, no statements, and copy thatsays it is too sparse — the summary refuses to describe a trend it cannot support.
app.jsrenders that card and a pattern-source sheet: following a citation opens exactly the citedrecords (
data-summary-record), with the window stated. Static content, so norole="status"liveregion was added (an earlier attempt collided with the capture-status live region in
tests/mobile-capture.acceptance.mjs; removed rather than weakening that test).ruling, or a health verdict.
Tests
tests/summary.test.js(unit): citations resolve to real in-window records, per-bucket citation sets,mixed-pattern line, out-of-window exclusion, no causal/diagnostic/food wording, sparse refusal.
tests/pattern-summary.acceptance.mjs(real browser): sparse window shows the refusal with zerostatement lines; a 5-log window (4 in-window + 1 old) renders the cited lines; following the typical
citation lists exactly
rec-typical-1/2/3.npm run test:pattern-summary), the unit suite,check:syntax, and the release builder(acceptance run +
longitudinal_pattern_summarymanifest gate + on-camera captions).Verification run in this branch
npm test→ 154 pass / 0 failnpm run test:pattern-summary→ PASSnpm run test:ui|photo|mobile-capture|sleek|manual-fallback|provisional|followup|vision-refusal|worker-readiness→ all PASSnpm run check:syntax,npm run check:diff→ OKnode scripts/record_release_demo.mjs→ real-browser recording (WebM, 163.9s) whose caption receiptcontains the two new gated captions; the citation check throws if the cited record set is wrong.
Demo path
scripts/record_release_demo.mjsnow seeds fictional multi-day sample logs into the app's own localledger contract, shows the summary, follows a citation, and then replays the sparse-window refusal. The
on-camera caption states the seeding and that no real health data is involved. No UI was invented for the
video, and no product boundary moved.
Evidence screenshots:
artifacts/pattern-summary-home-mobile.png,-records-mobile.png,-insufficient-mobile.png.Pull request closed