Skip to content

fix(desk): complete S2 desk observation, freshness and next-run fixes - #1171

Merged
Pigbibi merged 2 commits into
mainfrom
s2/completion-20261114
Nov 14, 2026
Merged

Pigbibi merged 2 commits into
mainfrom
s2/completion-20261114

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

AI assistance

Claude Code, model Claude Opus 5.5 (claude-opus-5-5), acting as the single implementing writer for the owner-approved SAME-S2 completion round (2026-11-14).

What changed

Five of the six code-only residuals from the end-of-batch review of #1170:

  1. Performance observation ordering (application/desk/performance.js). The last qualified day's observed_at is the chronologically newest normalized instant (epoch comparison), not lastTimes.sort().at(-1). A missing or unusable instant on that day still leaves no time basis, and equal instants normalize to the same text. Regressions cover whole, fractional and offset instants in both member orders, equity plus the four risk wrappers, the stale-age boundary (345599 s vs 345600 s), partial history by inception and by retention, null, undefined and unusable observations, and a null-flow control showing that history and return_basis are unchanged.
  2. LogsPage completeness (pages/LogsPage.tsx). The next-run line keeps the whole read: the qualified headline "earliest observed scheduled run", then coverage, the stored observation instant and, when stale, the reported age. Unknown names its reason. A null value reads "not observed", never "none due". A candidate whose due instant has passed on the local clock shows as passed. The page keeps its single api.ribbon() read per open: a one-time snapshot that is never polled and adds no storage read. The page says this on screen. The local clock is anchored to the snapshot's generated_at only to place "now". It never refreshes an observation or its age. Every time on the page carries its UTC date when that date is not the current UTC day. Rendering is split into a pure LogsView so it can be tested.
  3. Mixed-currency freshness (application/desk/overview.js). Freshness is gated on displayed fresh, bound, non-paper observations, not on the totals coverage. Mixed currencies keep unavailable totals and no FX, but now report their displayed age. n1-overview.degraded.json was regenerated through the test's own writer; the ok and partial goldens are unchanged.
  4. Next-run date and boundary docs (shell/TopBar.tsx, contract, ribbon.js comment). A next run on another UTC day than the viewer's shows its UTC date. Coverage and stale age are kept. The contract no longer claims that a past ?date= never reads today's record: until New York midnight, yesterday's UTC slice still overlaps the current New York business day. No expected or pending count is derived.
  5. Compatibility wording (contract §1/§4.B, operations.js comment, runtime-today test comment). The default todaySummary output shape is unchanged and has no schedule key. The approved completeness and chronological corrections intentionally change values that were wrong before. Comment and wording only; one test pins that the opt-in adds only the schedule key.

Not included: BenchmarkPanel state honesty. Telling "not requested" apart from "request failed", and dropping the loading state on the live path, needs a change in pages/PerformancePage.tsx: loadBenchmarks returns {phase: "failed"} when the read is not allowed, and the page sets {phase: "loading"} before it. That file is approved only for item 1 display consistency, so this item is held pending a binding exception.

How verified

  • node tests/desk_n1_projection_validation.mjs: pass
  • node --experimental-strip-types tests/console_desk_n1_validation.mjs: pass
  • node --experimental-strip-types tests/console_desk_phase8_validation.mjs: pass
  • node --experimental-strip-types tests/console_desk_benchmarks_validation.mjs: pass (unchanged)
  • node tests/runtime_today_incomplete_validation.mjs: pass
  • npm run test:operations --prefix web/strategy-switch-console: pass (exit 0)
  • npm run build (frontend: tsc, vite, size budget): pass; npm run sync:v2-assets regenerated v2_asset_map.js
  • node --experimental-strip-types tests/console_v2_assets_validation.mjs (45 assets) and tests/console_v2_worker_validation.mjs: pass
  • python3 scripts/check_style.py: 0 blocking, 1 advisory (README outline; the same advisory appears on the base)
  • build_config.py --check, build_display_names.py --check, runtime_settings.py validate: pass
  • Prove-it-fails for item 1: in a scratch copy with the pre-fix expression restored, 8 assertions in the new block fail. The first is "known: the later fractional instant is the newest, not the lexically last whole second". The item 4 all-fresh mixed-currency case also fails against base overview.js.

worker.js is hand-maintained source that imports the application modules, so the build did not change it.

Why

The independent review of #1170 found these residuals:

  • a lexical newest-observation pick in Performance
  • a Logs next-run line that dropped status, coverage and age
  • mixed-currency cohorts suppressing displayed freshness
  • next-run times that were ambiguous across UTC dates
  • an over-broad statement about UTC-day/NY-day overlap
  • an imprecise compatibility claim

Risk

Low. Read-only Desk projections and presentation, synthetic fixtures and tests only. No schema, package, lockfile, data source, scheduling, storage-read, write or deployment change. Values intentionally change in two places: the mixed-currency Overview freshness/data_age_seconds (now the displayed age instead of unavailable) and the Performance observed_at when instants within one second differ in fractional digits or offsets. No labels were added; risk classification is left to the normal gate.

🤖 Generated with Claude Code

Completion round for the SAME-S2 Desk corrections (review of #1170).

- Performance: the last qualified day's observation is the
  chronologically newest normalized instant, not the lexically last
  string; a missing or unusable instant still leaves no time basis.
- Overview: displayed-observation freshness no longer depends on
  aggregatability. Mixed-currency cohorts keep unavailable totals (no
  FX) but report the displayed facts' age. The degraded golden changes
  accordingly.
- Logs: the next-run line keeps status, coverage, the stored
  observation instant and stale age; a passed candidate expires on a
  local clock; times carry their UTC date across UTC midnight. The page
  keeps one ribbon read per open and makes no added read.
- TopBar: a next run on another UTC day shows its UTC date.
- Contract: correct the UTC-day/NY-day overlap statement and make the
  todaySummary compatibility claim precise (shape unchanged, values
  intentionally corrected). Comment-only change in operations.js.

The BenchmarkPanel state item is not included: it needs a
PerformancePage.tsx change outside the approved binding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T13:42:58.311238Z 39ee968 Manual request
🔒 Security Review ✅ Completed 2026-11-14T13:44:20.213030Z 39ee968 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

A live Performance page never reads the benchmark source, yet it reported
that intentional non-read as "failed" (fetch-failed copy beside the
contained copy) and briefly as "loading".

- Add a `not_requested` BenchmarkState; loadBenchmarks returns it when the
  source allows no read, without calling the API.
- The page starts in `not_requested` and sets `loading` only when a read
  will be made; PerformanceView shows a disallowed source as
  `not_requested` whatever state it holds.
- BenchmarkPanel renders `not_requested` with the contained copy only.
- Tests cover live/mock phases, both languages, and the unchanged
  zero-call and single api.benchmarks( pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Pigbibi

Pigbibi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Independent completion-round verdict: PASS WITH RESIDUALS. Blocking findings: 0.

QuantStrategyLab/QuantRuntimeSettings, PR #1171, branch s2/completion-20261114. Head: 39ee9682ad365b5582733c58fe82ed51b0776733. Base: aadb8f1b97a2471db283b7e003fdd954093afc6e. Date: 2026-11-14. Reviewer: Codex, GPT-6 family, independent read-only session, not the implementing writer.

This is an independent session review, not an official Codex GitHub App receipt or owner approval. unresolved_findings:0 means zero blocking defects for this completion scope. Residuals and an environmental test failure remain explicitly open; coverage:complete does not mean every check passed.

All six items pass independent code review:

  1. Performance selects the chronologically newest normalized observation for equity and four risk wrappers, preserving missing-time behavior and the null-flow live boundary.
  2. Logs preserves candidate status/coverage/observation/stale age, explicitly states its one-time snapshot, expires passed candidates locally and adds no API/storage read relative to base.
  3. Benchmark not_requested is distinct from loading/failure. Live prohibition, one guarded API call site and the zero-call/outbound-empty spies remain intact.
  4. Mixed-currency displayed freshness is independent of aggregation; NAV/FX totals remain unavailable and unchanged.
  5. Cross-UTC-date next-run labels and UTC/NY overlap documentation are corrected. No expected/pending count is derived.
  6. Compatibility wording now distinguishes unchanged output shape from approved earlier value corrections; operations code is unchanged.

Scope/build evidence: exactly 18 changed files, all bound; complete non-generated diff read. Operations/ribbon changes are comment-only. Independent clean frontend build and sync reproduce all 45 assets, HTML and build identifier byte-for-byte; the asset map is 1,344,219 bytes. No schema, lockfile, new source integration, flow wiring or execution authority change. Original checkout clean before/after; no remote or production writes/reads.

Prove-it-fails: five isolated reversions in a scratch tree fail their new assertions: performance selector, benchmark disallowed-load result, direct held-state rendering, loading initialization and the old panel. Restoring final code passes all three affected regression scripts. The initialization check is a source pin; the other four fail behavioral/render assertions.

Executed checks: all five bound test files; full console npm run test:operations after build; frontend TypeScript/Vite/budget; asset validation (143 references/45 assets); worker validation; Python config/display generation checks and settings validation; documentation style (0 blocking, one identical base advisory). All pass. Full Python unittest and interactive browser/production acceptance are not claimed.

Environmental failure: deploy-safety fails identically at head and the requested main base because the shallow clone lacks a pinned historical release commit; Git ancestry exits 128. Full-history hosted CI must clear it normally. No test was weakened or gate bypassed. Initial scratch-only missing-Git and missing-dist setup failures were resolved and are retained in the report.

Residual dispositions: c1's helper placement, stricter direct-input timestamp qualification, fixed snapshot age, separate Logs/shell reads and Chinese stale wording are accepted limitations; Overview has no next-run display, so no missing change exists there. c2-R1 is the confirmed environment failure. c2-R2 is accepted: unavailable rows/KPI with explicit “comparison is not read” are nonblocking and invent no values. The broader no-data footer remains optional wording cleanup, not proof about remote data availability. Logs' 30-second local tick is approximate, not an exact scheduling guarantee. None of these is silently called fixed.

The refreshed next-batch proposal treats 7A/8A/9A/12A/NA as approved design direction, not outstanding choices and not implementation authorization. It retains all class-C prerequisites (#14–17, #20/#24, #22, #25, #26), the open copy/maintenance/snapshot limits, production evidence gaps and separately scoped timestamp investigations. Class-D risk/analytics/alerts/execution work stays deferred.

The head is ready for the owner's merge decision based on this code review. Actual merge eligibility remains subject to current-head required hosted checks and the official review receipt; neither was re-read here. This document grants no merge, deployment, collection, notification or trading authority. Nothing was posted.

Full report: /tmp/s2-completion-rereview-REPORT.md. Evidence: /tmp/s2-completion-review-o7xkxnft/logs/.

@Pigbibi

Pigbibi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Owner approval — merge authorization (S2 completion round, PR #1171)

The account owner approved this merge in the Muse conversation at 2026-11-14T21:39:39+08:00 (Asia/Singapore), replying “批,合併 PR #1171” to the coordinator's merge request.

Approved for merge:

Field Value
PR #1171
Head 39ee9682ad365b5582733c58fe82ed51b0776733
Base main at aadb8f1b97a2471db283b7e003fdd954093afc6e
Scope 18 files (the completion-round binding; see PR diff)
Evidence Independent session review verdict: PASS WITH RESIDUALS, 0 blocking (posted as the codex-review-receipt:v1 comment above this one; independent session review, not an official Codex App receipt)

The coordinator posts this record on the owner's behalf and will add the agent-approved clearing label (never owner-approved). Merge proceeds only when the risk gate passes for this exact head, including official reviewer evidence covering this head.

@Pigbibi Pigbibi added the agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation label Nov 14, 2026
@Pigbibi

Pigbibi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 39ee9682ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 39ee9682ad

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@Pigbibi
Pigbibi merged commit d5bb6df into main Nov 14, 2026
20 of 22 checks passed
@Pigbibi
Pigbibi deleted the s2/completion-20261114 branch November 14, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant