Forq: outcome measurement, receipt benchmarking, optimiser engine, OpenRouter free-tier AI - #252
Merged
Merged
Conversation
…rdening - study.js: point-in-time replay scoring arise vs double-progression, linear-progression and flat baselines on identical transitions; paired win/loss stats, experience-level segmentation, sample gates - prospective ledger: programme-stamped records, coverage report with deficits, substitution validation, deload decision audit; ledger now travels in backups and sync merges (resolved beats unresolved) - MoreView: progression-evidence panel (coverage gaps, replay comparison, deload audit), consent-gated and lazily computed - engine correctness: session-level plateau analysis, DST-safe streaks, upserted session completion, corrupt-store quarantine, guarded import comparators, telemetry identity pinning, honest planned-volume deltas - equipment: onboarding collects dumbbell pairs and machine/cable stack increments; swap sheet honours movement preferences and blocks A-to-A cycles; rest timer +/- adjust; set-progress live region - PWA: network-first navigations (stale HTML fix), reload-only-on-update, cross-tab store refresh; boot-crash fixes from in-flight refactor benchmark:study runs the comparative harness over the synthetic corpus.
…-eval infra, public dashboard, plugin API v1
Core: truncate head/tail overlap fix, ANSI CSI final-byte range, prioritize
budget fill + Windows path refs, filter cap marker + Set perf, atomic stats
writes, structural O(n^2) removals, NDJSON single-parse.
Parsers: shared util (CRLF-safe split, uniform results), preservation fixes
(eslint file headers, cargo/go panics, maven/gradle stack frames, terraform
boxes, docker legacy/BuildKit errors, k8s pod rows), ruff multi-letter rule
codes, mvn/mvnw detection, next.js cap + index-based ordering.
CLI/tooling: child-flag passthrough (-- stops at first non-flag after
subcommand), Windows .cmd spawn retry + spawn-error diagnostics, stdout/newline
normalization, JWT/PEM/Google-key redaction, --exit-code for stdin, subcommand
--help, invalid-level exit 2, safe formatCost, config warning on unreadable
JSON, init gitignores .rtk/, plugin auto-load gated behind RTK_ALLOW_PLUGINS=1,
atomic stats save never clobbers wrapped exit code.
Product v0.4.0: --auto adaptive strength, machine-readable removals metadata,
PARSER_BEHAVIOR_VERSION semver, stable require('rtk/api') surface, slimmed
prepublishOnly, benchmarks out of published tarball.
Benchmarks: 33-tool live-capture catalog w/ provenance (sha256/host/command)
+ contributor ingest; parser fuzz harness (10 categories); external-benchmark
harness (independent-task manifests, seeded randomization, blind-judge
scrubbing, model tiers, framework adapters, Wilson/TOST reporting); public
dashboard generator + sanitized failure-corpus export. Tests: 137 -> 223.
…n, privacy retention, evidence split
Measured-only metrics over any window (default 28d): weekly spend · waste value+weight · discarded items · takeaway frequency (+honest-null spend) · plan adherence · leftover reuse · pantry accuracy incl depletion-vs-expiry deltas · list completion · planning-time median · unused ingredients · substitution frequency · savings confidence graded by trips x calendar coverage (seasonality needs 8 weeks). beforeAfterOutcomes gates pre/post comparison on a noise floor in both windows.
…arness - loyalty/multibuy savings captured as data (informational, never arithmetic); coupons and refunds are payment events that adjust the net total - weighed goods keep kg units and defer per-kg rates to the printed line total; quantity-prefixed single figures are computed and flagged low-confidence; substitutions flagged; independent shops named honestly - per-line confidence + flags; whole-receipt receiptConfidence() grading - receipt-benchmark corpus: Tesco/Sainsbury's/Aldi/Lidl/Morrisons/Asda/ Waitrose/Co-op/independent seed cases covering every line type incl. unreadable rejection; per-field/per-feature/per-retailer metrics
…invariants - split exercises into src/lib/data/exercises/* (one module per muscle group), re-exported from data.js - add 38 hand-authored exercises with reciprocal substitution chains; close bodyweight dead ends (Back, Arms) - lint:content now enforces progression enums, per-record cues, >=3 exercises per muscle and >=1 pure-bodyweight option per muscle - declare explicit strategies in priors for new ids (endurance for time-based work, strength compounds, hypertrophy overrides where the name regex would misfire) - tests 196 -> 201: library size, coverage floors, graph reciprocity, enum/cue validation
- cycle opt-in grants the optional tool at setup and from Goals - reminder preset flows seed everything-mode (presets stay mode-scoped) - waste-planner penalises fractional whole-unit splits so whole-unit plans win ties - live-region audit: quiet paragraphs demoted; load-bearing announcements kept - typography: skip-link font-size back to relative units
rankPlans() scores candidate plans on six transparent dimensions — pantry coverage, fed-in waste score, expiry coverage, budget fit, time fit, equipment fit (+ pack rounding) — each reported or null; nulls drop out of the weighting instead of faking 100. Shares are normalised to a 0-100 scale before blending; strict-equipment mode benches infeasible plans with an explained reason. chooseOptimalPlan returns the winner with per-candidate breakdown and plain-language reasons. optimiseBasket() consolidates the list by store, proposes single-trip plans when one shop covers 80%+, suggests cheaper substitutes from the household's own receipt history, and rounds quantities up to whole packs.
buildPlan gains a multiObjective option (default false — zero behaviour change until opted in). When on, chooseCandidate feeds the waste model's per-candidate scores into rankPlans as the wasteScores seam, letting pantry coverage and expiry urgency blend with pack-waste instead of waste deciding alone. Legacy shape preserved: waste fields stay spread at top level; optimiserScore/optimiserReasons added alongside. chooseCandidate is now exported for direct testing.
The planner now blends pantry coverage and expiry urgency with the pack-waste model for live generation, instead of waste deciding alone. Time and equipment remain hard filters upstream; budget stays a per-serving chip until a price table feeds the engine's budgetFit.
- ingredient-prepass lib: alias-aware normalisation, duplicate grouping, same-dimension quantity merging; mismatched dimensions never add - offline-sync: immutable queue + ordered replay; multi-user merge with LWW, lexical tie-breaks, version-conflict resolution shapes - measure properties: cross-dimension conversion refused, scaling linear/multiplicative, unit-price linearity in pack size - recipe scaling properties: frozen proportions, multiplicativity, dimension survival, identity factor - large-pantry perf floors: 600-row pantry, 8 candidate plans, 150-item basket — generous CI-safe budgets - axe-core Playwright sweep across primary tabs (e2e suite)
# Conflicts: # apps/arise/README.md # apps/arise/docs/IMPROVEMENTS.md # apps/arise/index.html # apps/arise/package.json # apps/arise/public/sw.js # apps/arise/src/App.jsx # apps/arise/src/components/AppShell.jsx # apps/arise/src/components/MoreView.jsx # apps/arise/src/components/Onboarding.jsx # apps/arise/src/components/ProgressView.jsx # apps/arise/src/components/SessionRunner.jsx # apps/arise/src/components/TrainView.jsx # apps/arise/src/lib/analytics.js # apps/arise/src/lib/attributes.js # apps/arise/src/lib/backtesting.js # apps/arise/src/lib/data.js # apps/arise/src/lib/export.js # apps/arise/src/lib/priors.js # apps/arise/src/lib/programming.js # apps/arise/src/lib/progression.js # apps/arise/src/lib/schedule.js # apps/arise/src/lib/sessionGenerator.js # apps/arise/src/lib/store.js # apps/arise/src/lib/substitutions.js # apps/arise/src/lib/sync.js # apps/arise/src/lib/telemetry.js # apps/arise/tests/data.test.js # apps/arise/tests/export.test.js # apps/arise/tests/plates.test.js # apps/arise/tests/programme-generator.test.js # apps/arise/tests/programming.test.js # apps/arise/tests/progression.test.js # apps/arise/tests/store.test.js # apps/emotion-tracker/README.md # apps/emotion-tracker/src/app/api/reflect/route.ts # apps/emotion-tracker/src/app/layout.tsx # apps/emotion-tracker/src/app/page.tsx # apps/emotion-tracker/src/components/ApiKeyBar.tsx # apps/emotion-tracker/src/components/HistoryView.tsx # apps/emotion-tracker/src/components/LongitudinalPanel.tsx # apps/emotion-tracker/src/components/NewEntryForm.tsx # apps/emotion-tracker/src/components/PatternsView.tsx # apps/emotion-tracker/src/components/PrivacyBar.tsx # apps/emotion-tracker/src/components/ReflectionSession.tsx # apps/emotion-tracker/src/components/SettingsView.tsx # apps/emotion-tracker/src/components/SummaryView.tsx # apps/emotion-tracker/src/components/Toast.tsx # apps/emotion-tracker/src/lib/adversarial.ts # apps/emotion-tracker/src/lib/corrections.ts # apps/emotion-tracker/src/lib/crypto.ts # apps/emotion-tracker/src/lib/evidenceReport.ts # apps/emotion-tracker/src/lib/gemini.ts # apps/emotion-tracker/src/lib/humanReview.ts # apps/emotion-tracker/src/lib/importExport.ts # apps/emotion-tracker/src/lib/longitudinal.test.ts # apps/emotion-tracker/src/lib/longitudinal.ts # apps/emotion-tracker/src/lib/memory.ts # apps/emotion-tracker/src/lib/observationVsInference.ts # apps/emotion-tracker/src/lib/outcomeEvidence.ts # apps/emotion-tracker/src/lib/outcomeStudy.ts # apps/emotion-tracker/src/lib/patternEvidence.ts # apps/emotion-tracker/src/lib/privacy.ts # apps/emotion-tracker/src/lib/privacyAudit.ts # apps/emotion-tracker/src/lib/pulse.ts # apps/emotion-tracker/src/lib/rateLimit.test.ts # apps/emotion-tracker/src/lib/rateLimit.ts # apps/emotion-tracker/src/lib/search.ts # apps/emotion-tracker/src/lib/useEntries.ts # apps/emotion-tracker/src/lib/useLocalStorage.ts # apps/emotion-tracker/src/lib/validation.ts # apps/food-shopping-os/src/components/DemoWalkthrough.jsx # apps/food-shopping-os/src/components/FamilyPanel.jsx # apps/food-shopping-os/src/components/LogCapture.jsx # apps/food-shopping-os/src/components/Onboarding.jsx # apps/food-shopping-os/src/components/PlanGenerator.jsx # apps/food-shopping-os/src/components/PrivacyPanel.jsx # apps/food-shopping-os/src/components/ProfileTab.jsx # apps/food-shopping-os/src/components/SmartFeaturesPanel.jsx # apps/food-shopping-os/src/le-studio.css # apps/food-shopping-os/src/lib/health-actions.js # apps/food-shopping-os/src/lib/planner.js # apps/food-shopping-os/src/lib/receipt.js # apps/food-shopping-os/src/lib/waste-planner.js # apps/food-shopping-os/tests/advanced-flows.test.jsx # apps/food-shopping-os/tests/advanced.test.js # apps/food-shopping-os/tests/reminder-flows.test.jsx # apps/rapport/package-lock.json # apps/rapport/src/ai/cache.ts # apps/rapport/src/ai/provider.ts # apps/rapport/src/ai/tasks.ts # apps/rapport/src/app/api/ai/route.ts # apps/rapport/src/app/coach/page.tsx # apps/rapport/src/app/evidence/page.tsx # apps/rapport/src/app/page.tsx # apps/rapport/src/app/practise/[scenarioId]/page.tsx # apps/rapport/src/app/progress/page.tsx # apps/rapport/src/app/settings/page.tsx # apps/rapport/src/components/reflection-form.tsx # apps/rapport/src/components/simulation-runner.tsx # apps/rapport/src/components/training-plan.tsx # apps/rapport/src/data/pulse-history.ts # apps/rapport/src/data/repository.ts # apps/rapport/src/domain/agreement.ts # apps/rapport/src/domain/analytics.ts # apps/rapport/src/domain/confidence.ts # apps/rapport/src/domain/donation.ts # apps/rapport/src/domain/evaluation.ts # apps/rapport/src/domain/events.ts # apps/rapport/src/domain/floor.ts # apps/rapport/src/domain/gaming.ts # apps/rapport/src/domain/interruption.ts # apps/rapport/src/domain/mastery.ts # apps/rapport/src/domain/progress.ts # apps/rapport/src/domain/recommender-benchmark.ts # apps/rapport/src/domain/scheduling.ts # apps/rapport/src/domain/simulator.ts # apps/rapport/src/domain/transfer.ts # apps/rapport/src/domain/types.ts # apps/rapport/src/domain/weekly-review.ts # apps/rapport/src/state/store.tsx # apps/rapport/tests/agreement.test.ts # apps/rapport/tests/analytics.test.ts # apps/rapport/tests/benchmark-persistence.test.ts # apps/rapport/tests/donation.test.ts # apps/rapport/tests/gaming.test.ts # apps/rapport/tests/persistence.test.ts # apps/rapport/tests/transfer.test.ts # apps/rtk/README.md # apps/rtk/benchmark/corpus/manifest.json # apps/rtk/package.json # apps/rtk/src/ansi.js # apps/rtk/src/cli.js # apps/rtk/src/config.js # apps/rtk/src/filter.js # apps/rtk/src/init.js # apps/rtk/src/parsers/cargo.js # apps/rtk/src/parsers/docker.js # apps/rtk/src/parsers/eslint.js # apps/rtk/src/parsers/gotest.js # apps/rtk/src/parsers/gradle.js # apps/rtk/src/parsers/index.js # apps/rtk/src/parsers/k8s.js # apps/rtk/src/parsers/maven.js # apps/rtk/src/parsers/next.js # apps/rtk/src/parsers/pytest.js # apps/rtk/src/parsers/ruff.js # apps/rtk/src/parsers/terraform.js # apps/rtk/src/plugins.js # apps/rtk/src/prioritize.js # apps/rtk/src/redact.js # apps/rtk/src/run.js # apps/rtk/src/stats.js # apps/rtk/src/structural.js # apps/rtk/src/truncate.js
- /api/ai prefers OpenRouter :free models when OPENROUTER_API_KEY is set (catalog-cached picker, preferred families first); free models bypass the monthly AI budget — rate-limit only as an abuse guard — and fall back to the paid relay when no free slot answers - recipe favourite: solid red fill, white heart, ring-pulse on select alongside the existing pop animation
GLM 5.2 → Nemotron 3 Ultra → 3.5 Lightning → 3 Super → Gemma 4 31B → 26B A4B → Nano 30B A3B → Nano 12B VL → Nano 9B → LFM2.5 → North Mini Code → Inkling Small → Inkling → Laguna → Dots3. Embeddings, rerankers, TTS and safety classifiers are excluded from chat selection entirely. freeChat walks the ranking on rate limits/outages and refuses after a 401 (a bad key never fixes itself on the next model).
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
Local suite green except the known deferred invariant (500-line boundary refactor).