Skip to content

Update Cargo.lock with 22 changed files (#2727)#2738

Merged
rysweet merged 6 commits into
mainfrom
feat/issue-2727-in-the-simard-dashboard-header-alongside-the-build
Jul 7, 2026
Merged

Update Cargo.lock with 22 changed files (#2727)#2738
rysweet merged 6 commits into
mainfrom
feat/issue-2727-in-the-simard-dashboard-header-alongside-the-build

Conversation

@rysweet

@rysweet rysweet commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Concise workflow-generated PR for Cargo.lock.

Issue

Closes #2727

Changed files

  • Cargo.lock
  • Cargo.toml
  • build.rs
  • docs/dashboard.md
  • docs/index.md
  • docs/operator-dashboard/agent-terminal-agent-picker.md
  • docs/reference/dashboard-goal-hierarchy-priority.md
  • docs/reference/dashboard-header-deployment-datetime.md
  • mkdocs.yml
  • src/goal_curation/decompose.rs
  • src/goal_curation/prioritize.rs
  • src/goal_curation/tests_prioritize.rs
  • src/operator_commands_dashboard/goals.rs
  • src/operator_commands_dashboard/index_html/part_01.rs
  • src/operator_commands_dashboard/routes.rs
  • src/operator_commands_dashboard/tests_attach.rs
  • src/operator_commands_dashboard/tests_routes_a.rs
  • src/operator_commands_dashboard/tmux.rs
  • src/status/json.rs
  • src/status/mod.rs
  • src/status/provider.rs
  • src/status/render.rs

Diff stat

 docs/dashboard.md                                  |   3 +-
 docs/index.md                                      |   1 +
 .../agent-terminal-agent-picker.md                 | 326 ----------------
 .../reference/dashboard-goal-hierarchy-priority.md |   3 +-
 .../dashboard-header-deployment-datetime.md        | 320 +++++++++++++++
 mkdocs.yml                                         |   2 +-
 src/goal_curation/decompose.rs                     |   5 +-
 src/goal_curation/prioritize.rs                    |  18 +-
 src/goal_curation/tests_prioritize.rs              |  15 +-
 src/operator_commands_dashboard/goals.rs           |  44 +--
 .../index_html/part_01.rs                          |  84 +---
 src/operator_commands_dashboard/routes.rs          |  46 +++
 src/operator_commands_dashboard/tests_attach.rs    | 146 -------
 src/operator_commands_dashboard/tests_routes_a.rs  | 318 +++++++++++++++
 src/operator_commands_dashboard/tmux.rs            |  92 +----
 src/status/json.rs                                 |  37 --
 src/status/mod.rs                                  |  81 ----
 src/status/provider.rs                             | 212 ----------
 src/status/render.rs                               | 427 ---------------------
 22 files changed, 831 insertions(+), 1431 deletions(-)

Behavior

Implemented behavior through these branch commits:
339a773 feat: In the Simard dashboard HEADER, alongside the build number already shown
58a64e6 test(dashboard): integration-test #2727 /api/status deployed wiring + auth
80cca9c perf(dashboard): cache #2727 deployed timestamp string (parse/format once)
83ca3a8 wip: checkpoint after implementation (steps 7-8)

Validation

ℹ NODE_OPTIONS=--max-old-space-size=32768 (saved preference). To change: /home/azureuser/.amplihack/config
I'll start by understanding the current state: branch, changes made, and the affected code.

● Get branch name, status, and diff stat (shell)
│ cd /home/azureuser/src/Simard/worktrees/feat/issue-2727-in-the-simard-dashboard-header-alongside
│ -the-build && git branch --show-current && echo "---STATUS---" && git status --short && echo
│ "---DIFF STAT vs main---" && git --no-pager diff --stat origin/main...HEAD 2>/dev/null || git
│ --no-pager diff --stat main...HEAD 2>/dev/null
└ 15 lines…

The implementation is already done. Let me review the changes to understand what's being tested.

Risk

No high-risk subsystem pattern detected from changed paths.

Checklist

  • Branch has 4 commit(s) ahead of main
  • Code review completed
  • Philosophy check passed

This PR was created as a draft for review before merging.


Step 16b: Outside-In Testing Results

Tested the PR branch as a consumer would, from the external /api/status boundary and by launching the real dashboard binary. Fixes required: 0 — all scenarios passed on the first run.

Detected toolchains

  • Language / package manager: Rust + Cargo (Cargo.toml at repo root, edition 2024, rustc 1.95.0, cargo 1.95.0).
  • Deployment-datetime source: compile-time timestamp baked by build.rs into SIMARD_BUILD_TIMESTAMP (vergen-style; honors SOURCE_DATE_EPOCH). Runtime UTC→America/Los_Angeles conversion via chrono + chrono-tz (%Z yields the date-correct PST/PDT abbreviation).
  • Manifests/lockfiles: Cargo.toml, Cargo.lock (both changed), [build-dependencies] added.
  • Entry point exercised: simard dashboard serve --port=PORToperator_commands_dashboard::routes::build_router()GET /api/status.
  • Documented commands (CI verify.yml): cargo test --all-features --locked --no-fail-fast, cargo fmt --check, cargo clippy.

Chosen strategy

Per the qa-team repo-type detection, Cargo.toml at root ⇒ Rust repo ⇒ native cargo test at the outside-in HTTP/user boundary (the gadugi-agentic-test framework is not required for Rust CLI repos). Boundaries exercised: (a) the pure PT formatter, (b) the real build_router() served over an ephemeral loopback HTTP server, and (c) a genuine simard dashboard serve process probed with curl.

Scenarios

# Type Scenario Command Result
1 Simple (unit) PT formatting: winter→PST, summer→PDT; header renders build# + deployment datetime cargo test --all-features --locked --lib -- deployment_ deployed_ index_html_header_shows_build_number_and_deployment_datetime ✅ pass
2 Edge (DST) Spring-forward edge renders PDT (UTC-7); fall-back edge renders PST (UTC-8); stable YYYY-MM-DD HH:MM ABBR shape same as #1 (deployment_datetime_spring_forward_edge_is_pdt, ..._fall_back_edge_is_pst) ✅ pass
3 Integration (real router) Unauth GET /api/status denied 401; authed request wires deployed == canonical deployed_pt() with a DST-aware PST/PDT shape cargo test --all-features --locked --lib -- api_status_denies_unauth_and_wires_deployed_2727 ✅ pass
4 End-to-end (real binary, as a user) Launch actual dashboard, hit /api/status; unauth 401, authed shows real PT deployment datetime; served HTML carries header-version + d.deployed wiring simard dashboard serve --port=18727 + curl ✅ pass

Key output

Scenario 1–3 (all 10 feature tests):

running 10 tests
test ...::deployment_datetime_summer_renders_pdt ... ok
test ...::deployment_datetime_winter_renders_pst ... ok
test ...::deployment_datetime_spring_forward_edge_is_pdt ... ok
test ...::deployment_datetime_fall_back_edge_is_pst ... ok
test ...::deployment_datetime_format_shape_is_stable ... ok
test ...::deployment_timestamp_is_baked_in_at_build_time ... ok
test ...::deployed_pt_matches_formatter_over_env_timestamp ... ok
test ...::index_html_header_shows_build_number_and_deployment_datetime ... ok
test ...::api_status_denies_unauth_and_wires_deployed_2727 ... ok
test result: ok. 10 passed; 0 failed; 0 ignored; 7540 filtered out

Scenario 4 (real simard dashboard serve + curl):

=== unauth  /api/status ===  HTTP 401
=== authed  /api/status ===
version:  0.28.0.214
git_hash: 339a773fecc77acd1d91f56ecb3a72066ba43afc
deployed: 2026-07-06 15:53 PDT        # 22:53 UTC → 15:53 PDT (UTC-7), correct DST abbreviation
served HTML wiring: header-version, d.deployed   # header shows build# · deployed <PT datetime>

Quality gates

  • cargo fmt --check → clean (exit 0).
  • cargo clippy --lib --all-features --locked → no warnings on changed files (routes.rs, build.rs, part_01.rs, tests_routes_a.rs).

Fix count

0 — no failures encountered; no code changes were required during outside-in testing.

rysweet and others added 4 commits July 6, 2026 21:40
Automatic checkpoint to preserve work in progress.
Tests and implementation saved before refactoring phase.
…once)

deployed_pt() re-parsed the compile-time-constant SIMARD_BUILD_TIMESTAMP
(RFC3339), re-ran the America/Los_Angeles DST conversion, and re-allocated
the display string on every /api/status request. The value is fixed for the
process lifetime, so memoize it with LazyLock and return the cached
&'static str — eliminating the redundant per-request parse, timezone lookup,
format, and heap allocation. Mirrors the parse-once SENTINEL_SESSION_ID
pattern in goal_curation. Behavior and JSON output are unchanged; all three
tested helpers remain intact.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… auth

Closes the two converging review recommendations (Security + Philosophy)
that the pure-helper unit tests could not reach, in one end-to-end test
against the real build_router():

- Security: an unauthenticated GET /api/status is denied with 401, so the
  additive `deployed` field never leaks past the auth layer.
- Philosophy: the private status() handler actually wires `deployed` into
  the response JSON when the compile-time build timestamp is present (the
  single json!() insertion the unit tests can't exercise); the surfaced
  value equals deployed_pt() and carries the DST-aware PST/PDT shape.

Runs the router over an ephemeral loopback server speaking raw HTTP/1.1 —
no new test dependency, no production-code change. Authenticates via the
deterministic SIMARD_DASHBOARD_TOKEN bearer path and carries the
cognitive_memory serial key per the enforced env-mutation contract.

Explicitly did NOT replace LazyLock with a plain fn (review WON'T DO:
acceptable, matches SENTINEL_SESSION_ID precedent, net-negative churn).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ady shown

Implements issue #2727

Changes:
- Implementation as per design specification
- Tests added for new functionality
- Documentation updated

Closes #2727

@rysweet rysweet left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step 17b — Comprehensive Code Review (#2738 / issue #2727)

Verdict: Changes needed before merge — one blocking CI failure is caused by this PR. The feature code itself is well-designed, correct, and fully tested; the blocker is a supply-chain gate, not the implementation.

(Posted as a COMMENT review — GitHub does not allow the PR author to formally request changes on their own PR.)


🔴 Blocking — caused by this PR

1. cargo-vet fails: 3 new dependencies are unvetted.
The three crates this PR pulls in have no safe-to-deploy entry in supply-chain/config.toml:

Vetting Failed!
3 unvetted dependencies:
  chrono-tz:0.10.4   missing ["safe-to-deploy"]
  phf:0.12.1         missing ["safe-to-deploy"]
  phf_shared:0.12.1  missing ["safe-to-deploy"]

phf/phf_shared are already exempted at 0.11.3, but cargo-vet is version-specific and chrono-tz 0.10.4 brings in the new 0.12.1 line. Fix: add exemptions (or real audits) for these three crate@version pairs to supply-chain/config.toml, e.g.:

[[exemptions.chrono-tz]]
version = "0.10.4"
criteria = "safe-to-deploy"

[[exemptions.phf]]
version = "0.12.1"
criteria = "safe-to-deploy"

[[exemptions.phf_shared]]
version = "0.12.1"
criteria = "safe-to-deploy"

(Preferred long-term: cargo vet certify/import a trusted audit rather than a bare exemption.) This is the only red check attributable to the PR's changes.


🟠 Red on the PR, but not caused by this change (still blocks merge)

2. cargo-deny / cargo-audit fail on RUSTSEC-2026-0204.
The advisory is in crossbeam-epoch 0.9.18, pulled via moka → rustyclawd-tools → simard — a pre-existing dependency untouched by this PR (a newly published advisory, yanked/vulnerability = "deny" in deny.toml):

error[vulnerability]: Invalid pointer dereference in fmt::Pointer impl … (crossbeam-epoch 0.9.18)
Solution: Upgrade to >=0.9.20 (cargo update -p crossbeam-epoch)
advisories FAILED, bans ok, licenses ok, sources ok

Not this PR's regression, but it will keep the checks red. Resolve out-of-band with cargo update -p crossbeam-epoch (→ ≥0.9.20) or a justified ignore in deny.toml. Worth a one-line note in the PR so reviewers don't chase it as a chrono-tz problem.


✅ Code quality — approved on the merits

Checklist results against the changed feature files (build.rs, routes.rs, part_01.rs, tests_routes_a.rs):

  • No TODOs / stubs / unimplemented! / swallowed errors / stray unwrap/panic in production code. Errors degrade cleanly (option_env!None → field omitted).
  • Logic correctness — good. All timezone/DST logic is centralized in format_deployed_pt using the %Z token over chrono_tz::America::Los_Angeles, so PST/PDT and the ±offset are chosen from the tz database per-instant — nothing is hardcoded. Server-side formatting keeps the browser free of tz math.
  • Edge cases — well covered. Tests pin summer→PDT, winter→PST, and both DST transition edges (spring-forward, fall-back) with fixed UTC instants, plus format-shape and the end-to-end env/None degradation path.
  • Security — verified. The new integration test asserts unauthenticated GET /api/status401, so deployed can't bypass require_auth. Header render uses textContent (not innerHTML) → no XSS.
  • Back-compat — verified. deployed is strictly additive; omitted (not faked/empty) when the build timestamp is absent; JS guards with d.deployed ? … : ''. #header-version span reused, inheriting existing .75rem/#8b949e styling.
  • Test coverage — adequate. 63 lib tests incl. the new integration test; build + coverage CI checks pass.

🟡 Minor / non-blocking notes (optional)

  • build.rs timestamp freshness semantics. SIMARD_BUILD_TIMESTAMP is captured when build.rs runs, and build.rs only re-runs on the existing rerun-if-changed triggers (.git/HEAD, refs) or SOURCE_DATE_EPOCH change. An incremental cargo build that changes only source (no new commit) won't refresh it, so deployed reflects the last build-script invocation, not that exact rebuild. This matches the existing SIMARD_BUILD_NUMBER behavior and is fine for the "a build is a deploy (new commit)" model — just documenting the boundary. If per-rebuild freshness is ever required, add println!("cargo:rerun-if-changed=build.rs"); won't suffice; you'd need an always-changing trigger.
  • Doc example version drift (cosmetic). docs/reference/dashboard-header-deployment-datetime.md shows v0.27.0.1234 while the crate is now 0.28.0. Illustrative only.
  • PR title ("Update Cargo.lock with 22 changed files") is auto-generated and doesn't describe the feature; consider retitling to the #2727 deployment-datetime feature for a cleaner history.

Bottom line: implementation is solid and complete. Unblock by adding the three cargo-vet exemptions (PR-caused) and clearing the pre-existing crossbeam-epoch advisory; then all gates go green.

Comment thread Cargo.toml
# conversion (chrono alone has no DST-aware named zones). `=`-pinned to match
# the repo convention (e.g. `chrono = "=0.4.44"`); the pin is what makes the
# %Z abbreviation reproducible and lets the PST/PDT unit tests act as a guard.
chrono-tz = "=0.10.4"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 cargo-vet blocker: adding chrono-tz 0.10.4 pulls in phf 0.12.1 + phf_shared 0.12.1, and none of the three have a safe-to-deploy entry, so cargo vet fails (only phf 0.11.3 is currently exempted). Add exemptions/audits for chrono-tz@0.10.4, phf@0.12.1, phf_shared@0.12.1 in supply-chain/config.toml to turn the check green.

@rysweet

rysweet commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Step 17d — Philosophy Guardian Review

Verdict: ✅ PASS (philosophy-compliant) — no code changes required.

Reviewed the actual branch diff for #2727 (10 files, +761/-14): build.rs, Cargo.toml, routes.rs, part_01.rs, tests, and docs.

Compliance against core principles

  • Ruthless simplicity ✅ — Three tiny, single-purpose helpers (deployed_timestamp_utc, format_deployed_pt, deployed_pt). No speculative abstraction. Reuses the existing compile-time build-signal pattern (SIMARD_BUILD_NUMBER/SIMARD_GIT_HASH) symmetrically.
  • Modularity (bricks & studs) ✅ — All timezone/DST logic owned in one place (format_deployed_pt, via %Z). Contract is a clean additive deployed field on GET /api/status; nothing hardcoded to a fixed offset or literal PST/PDT.
  • Zero-BS ✅ — No stubs, TODOs, or dead code. Graceful degradation is real: when no timestamp is baked in, the field is omitted, not faked/empty. Option propagation is explicit and documented — no swallowed errors.
  • Library vs custom ✅ — chrono-tz is the correct choice for DST-aware named zones (chrono alone cannot); =-pinned per repo convention, which is what makes the %Z abbreviation reproducible under test.
  • Present-moment focus ✅ — Solves exactly In the Simard dashboard HEADER, alongside the build number already shown, ALSO display the DEPLOYMENT DATETIME rendered in US Pacific Time (PT — i.e. America/Los_Angeles, which shows PST or PDT with t #2727; no future-proofing. LazyLock cache is justified (parse/convert once per process) and mirrors the existing SENTINEL_SESSION_ID parse-once pattern.
  • Regeneration-ready & documented ✅ — Rustdoc explains the why (build=deploy rationale, DST behavior, cache rationale). New reference doc added and linked in docs/index.md, docs/dashboard.md, and mkdocs.yml nav.

Verification

  • cargo fmt --check → clean
  • cargo clippy --lib --all-features --locked → 0 warnings
  • Targeted tests → 10 passed, 0 failed (winter/summer, spring-forward & fall-back DST edges, baked-in timestamp, formatter/env parity, header render, /api/status auth + wiring)

Non-blocking notes (cosmetic — not philosophy violations)

  1. The helpers are pub(crate) primarily to expose pure, independently-testable seams — a good testability trade-off, not over-exposure.
  2. PR description drift: the "Changed files"/diff-stat in the PR body is stale (lists 22 files with large deletions from an unrelated base). The real branch diff is 10 files, +761/-14. Recommend refreshing the PR body before merge so reviewers aren't misled — no code impact.

Conclusion: Implementation is complete, correct, and aligned with the development philosophy. The "Philosophy check passed" checklist item can be marked done.

…0.12 for cargo-vet

The dashboard header timezone feature (issue #2727) introduces chrono-tz 0.10.4,
which pulls in phf 0.12.1 and phf_shared 0.12.1. These were failing the cargo-vet
supply-chain CI check as unvetted. Added safe-to-deploy exemptions consistent with
the existing phf 0.11.3 / phf_shared 0.11.3 exemptions already in the config.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rysweet

rysweet commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

PR Review — Step 17e: Blocking Issues Addressed ✅

Scope: Dashboard header timezone/build display (issue #2727). Reviewed routes.rs, index_html/part_01.rs, build.rs, new tests in tests_routes_a.rs, and dependency/supply-chain impact.

Code quality ✔

  • Production code is clean: no TODO/FIXME, no unwrap()/panic!/unimplemented!/unreachable! in the changed prod files.
  • Header span styling verified in part_01.rs.
  • New route tests added and the local suite (cargo test --release --lib …), cargo fmt, and cargo clippy --all-targets --all-features -D warnings all pass (enforced by pre-push hooks on the fix commit).

🔴 Blocking issue found — and FIXED in 6ecd5986

The chrono-tz 0.10.4 dependency (used for the header timezone rendering) transitively pulls in phf 0.12.1 and phf_shared 0.12.1. All three were unvetted, causing the cargo-vet supply-chain check to fail:

3 unvetted dependencies:
  chrono-tz:0.10.4 missing ["safe-to-deploy"]
  phf:0.12.1 missing ["safe-to-deploy"]
  phf_shared:0.12.1 missing ["safe-to-deploy"]

Fix: added safe-to-deploy exemptions for the three crates in supply-chain/config.toml, consistent with the existing phf 0.11.3 / phf_shared 0.11.3 / phf_codegen 0.11.3 exemptions already present. Verified locally:

Vetting Succeeded (543 exempted)

ℹ️ Pre-existing failures — NOT caused by this PR (out of scope)

cargo-deny and cargo-audit fail on RUSTSEC-2026-0204 (crossbeam-epoch 0.9.18, pulled via moka). This dependency and version are identical on origin/main, so the advisory is pre-existing and unrelated to this change. It should be addressed separately (e.g., a moka bump or advisory ignore), not in this feature PR.

Verdict

Feature code is sound. The one PR-introduced blocking failure (cargo-vet) is resolved by 6ecd5986. Remaining red checks are pre-existing supply-chain advisories outside this PR's scope.

@rysweet rysweet left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — Issue #2727 deployment timestamp in dashboard header

Verdict: Solid, well-tested change. One actionable item (branch is behind main); everything else is strengths / optional polish. Posting as a comment since I'm the PR author (GitHub blocks self-approval).

What this does

Bakes a compile-time build timestamp (SIMARD_BUILD_TIMESTAMP, RFC3339 UTC) via build.rs, then surfaces it in the dashboard header as an additive /api/status deployed field rendered in US Pacific time (2026-07-06 11:03 PDT).

Strengths

  • Correct TZ/DST handling. format_deployed_pt uses chrono_tz::America::Los_Angeles + the %Z token, so PST/PDT and the offset are chosen from the tz database rather than hardcoded. The 4 DST edge-case tests (summer PDT, winter PST, spring-forward gap, fall-back transition) directly prove this.
  • Back-compatible & safe. The deployed field is only inserted when present (option_env!None degrades gracefully), and the JS append is guarded with d.deployed?. No existing /api/status fields change.
  • Reproducible builds. build.rs honors SOURCE_DATE_EPOCH and sets the correct cargo:rerun-if-* triggers.
  • Efficient. deployed_pt() caches the parse + TZ conversion via LazyLock and returns a &'static str, mirroring the existing SENTINEL_SESSION_ID pattern — no per-request allocation.
  • Clean production code. No TODOs/unwrap()/panic!/stubs in build.rs, routes.rs, or part_01.rs. New deps (chrono-tz, phf 0.12) are =-pinned per repo convention and already have cargo-vet exemptions added.
  • Strong test coverage (63 tests in tests_routes_a.rs, including exact-format assertions for the deployed field).

CI status — action required

The push-event cargo-audit and cargo-deny are red, but this is not caused by this PR:

  • Both fail only on the pre-existing advisory RUSTSEC-2026-0204 (crossbeam-epoch, transitive via moka).
  • main's deny.toml already carries a justified ignore for it; this branch is 4 commits behind main and lacks that entry (confirmed: grep -c RUSTSEC-2026-0204 deny.toml → 0 on branch, 1 on main).
  • Proof: the pull_request-event run (branch merged with base) has cargo-audit, cargo-deny, and cargo-vet all green.
  • cargo-vet passes in both runs, so the new chrono-tz/phf deps are correctly vetted.

Fix: merge/rebase main into the branch to pick up the RUSTSEC-2026-0204 ignore; the push-event supply-chain checks will then go green too.

Optional / non-blocking

  • build.rs falls back to chrono::Utc::now() when SOURCE_DATE_EPOCH is unset/unparseable — reasonable, though it means non-reproducible builds get wall-clock time. Fine given the "build == deploy" rationale documented in the comment.

Once the branch is up to date with main, this is good to merge.

…e-simard-dashboard-header-alongside-the-build
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

📊 Coverage Summary

Generated by cargo llvm-cov --workspace --summary-only (nightly, excluding test files)

Module Lines Covered Coverage
Total 148269 124191 83.8%

Coverage data from CI run. Test files matching tests?/ are excluded from line counts.

@rysweet rysweet marked this pull request as ready for review July 7, 2026 00:05
@rysweet rysweet merged commit cb09e8b into main Jul 7, 2026
17 checks passed
@rysweet rysweet deleted the feat/issue-2727-in-the-simard-dashboard-header-alongside-the-build branch July 7, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant