Skip to content

[WIP] Fix issues in Copilot workflow - #206

Merged
ohgeeceee merged 2 commits into
feat/v0.14.4-story-anonymize-testsfrom
copilot/fix-with-copilot-another-one
Jul 31, 2026
Merged

[WIP] Fix issues in Copilot workflow#206
ohgeeceee merged 2 commits into
feat/v0.14.4-story-anonymize-testsfrom
copilot/fix-with-copilot-another-one

Conversation

Copilot AI commented Jul 31, 2026

Copy link
Copy Markdown
Contributor
  • Investigate CI failure in run 30632938666 / job 91164358297
  • Fix gh pr merge --auto → direct REST merge in ci.yml

@ohgeeceee
ohgeeceee marked this pull request as ready for review July 31, 2026 13:19
@ohgeeceee
ohgeeceee merged commit 940924b into feat/v0.14.4-story-anonymize-tests Jul 31, 2026
5 checks passed
Copilot stopped work on behalf of ohgeeceee due to an error July 31, 2026 13:19
Copilot AI requested a review from ohgeeceee July 31, 2026 13:19
@github-actions

Copy link
Copy Markdown

🤖 Doc-only change — auto-merge enabled. Will merge once required checks pass.

1 similar comment
@github-actions

Copy link
Copy Markdown

🤖 Doc-only change — auto-merge enabled. Will merge once required checks pass.

ohgeeceee added a commit that referenced this pull request Jul 31, 2026
* docs(roadmap): audit v0.3.0 historical section — stale 🟢 Ready items moved to ✅ Done

Six items in the v0.3.0 'Real Car' historical section were
marked 🟢 Ready but have actually shipped:

| Item                  | Shipped in      | Reference                |
|-----------------------|-----------------|--------------------------|
| KWP2000 slow timeout  | v0.13.0 (PR #153) | commit fd9efc2          |
| ISO-TP multi-frame    | v0.14.x         | src-tauri/src/transport/isotp.rs (enforced by CLAUDE.md, refreshed in PR #198) |
| Dark/light theme      | v0.7.0 (PR #109) | commit afefc32           |
| Gauge theming         | v0.7.0 (PR #109) | commit afefc32           |
| Save/load workspace   | v0.7.0 (PR #109) | commit afefc32           |
| Export PNG/SVG charts | v0.11.0 (PR #136) | commit 7f92ccb          |

This is the same doc-rot pattern that PR #198 fixed in
CLAUDE.md: items the inventory still claims as 'Ready to land'
have actually shipped, but nobody re-tagged the historical
section afterward. Same 'data over invention' fix as the
CLAUDE.md refresh.

What changed:

- '⭐ Protocol & Transport' table — kept the four genuinely-🟡
  items (ENET/DoIP, BLE, WiFi, CAN-bus listener), removed the
  two stale 🟢 Ready items.
- 'UI / UX' table — kept the only genuinely-🟡 item (Mobile-
  responsive), removed the five stale 🟢 Ready items.
- New '✅ Protocol, Transport, UI/UX — historical (shipped)'
  table — pins the six shipped items with their PR references
  and code locations, following the v0.3.0 'Decode Functions'
  historical pattern that already exists just above.

What this PR does NOT change:

- No CHANGELOG.md edits (the shipped-PR references are in
  CHANGELOG.md already)
- No CLAUDE.md edits (the ISO-TP / keepalive / read_vin
  references there are already accurate post PR #198)
- No code edits
- No test edits (markdown only)

Verified locally (docs-only, no test diff expected):

- node --test src/js/**/*.test.js src/js/**/*.test.cjs: 226/226
- python -m pytest backend/tests/ -q: 166/166
- cd src-tauri && cargo test --lib --offline: 149/149
- npm run build: rc=0, both BeeEmUu_0.14.3 bundles built

Tier A docs-only per CLAUDE.md. Self-merge on CI green.

Cross-references:
- PR #198: 'docs: refresh CLAUDE.md hardware/timing invariants'
  (the same doc-rot sweep on CLAUDE.md)
- PR #183: 'docs(proposal): fix stale NOT YET IMPLEMENTED claims'
  (proposed similar fixes but never applied)

* feat(v0.14.4): story coverage — 52 unit tests for story.rs + anonymize.rs

Two user-facing Rust modules have shipped with **zero unit
tests** since the diagnostic-story + secure-snapshot-share
features landed:

- `src-tauri/src/story.rs` (350 LOC) — the Generate Story
  pipeline that powers the one-click mechanic narrative
  modal in `src/index.html:513` +
  `src/js/main.js:2961` (renderStory).
- `src-tauri/src/anonymize.rs` (113 LOC) — the VIN-stripping
  layer that powers the Secure Snapshot Share feature
  (`src/js/main.js:1071`).

Both are pure-Rust, deterministic, and snapshot-driven —
the right shape for unit tests with fixture-built
`SessionSnapshot` inputs. This PR adds 52 unit tests
covering:

**story.rs (32 tests):**
- `Severity::from_str` bucketing (critical / warning /
  unknown → info).
- `Severity` ordering (Critical > Warning > Info).
- `priority_for` severity → priority number.
- `parse_cost_range` parser: single value, tilde,
  hyphen, **en-dash** (the TOML files use en-dash —
  parser must normalise), whitespace, empty, garbage.
- `format_vehicle` for empty / VIN-only /
  mileage-only / decoded.
- `build_context` freeze-frame string assembly.
- Full `generate` pipeline:
  - empty snapshot → Info story with no findings.
  - unknown DTC → generic Info finding.
  - n55-specific DTC (2A82) → uses engine template.
  - generic DTC fallback when engine-specific missing.
  - severity = max of all findings (sorted critical-first).
  - recommendations sorted ascending by priority.
  - cost range sums across findings.
  - cost-max invariant: max >= min + 50.
  - DTC code case-insensitive lookup (TOML keys are
    uppercased on load).
  - summary text counts critical + warning correctly.
  - title uses manufacturer + VIN prefix.

**anonymize.rs (20 tests):**
- `hash_vin` properties: 16 hex chars, stable for same
  input, distinct for distinct inputs, case-sensitive
  (current behaviour pinned).
- `anonymize` pipeline:
  - VIN never leaks into the anonymized JSON.
  - VIN → fingerprint via hash_vin.
  - Missing VIN → "unknown" fingerprint.
  - engine_family preserved from suggested_profile.
  - engine_family defaults to "generic".
  - Modules / DTCs / freeze frames / ident all preserved.
  - Mileage (mileage_km) stripped (privacy).
  - Empty modules handled.
  - fault_count = None → 0 in the output.
  - recorded_at populated with "(UTC)" suffix.
  - live_data is always empty (current anonymizer
    strips it; pinning the decision).
- `export_json`:
  - No VIN leak in pretty JSON.
  - No mileage leak.
  - Pretty-printed (multi-line + indented).
  - Round-trips through serde.

## Verification

- `cd src-tauri && cargo test --lib --offline` — **201/201
  pass** (149 existing + 52 new).
- `cd src-tauri && cargo test --test async_commands
  --offline` — 1/1 (the CLAUDE.md invariant guard still
  green — no new sync commands).
- `node --test src/js/**/*.test.js src/js/**/*.test.cjs`
  — 226/226 (no JS diff).
- `pytest backend/tests/ -q` — 166/166 (no backend diff).
- `npm run build` — rc=0, 2m32s; both BeeEmUu_0.14.3
  bundles built.

## Tier

**A** — pure additions to existing Rust modules, no
`transport/**` / `protocol/**` / `commands.rs` /
`.claude/**` touches. Self-merge on CI green per
CLAUDE.md rule 2.

## Cross-references

- The Story modal UI is `renderStory` in
  `src/js/main.js:2961`, the button at
  `src/index.html:513`.
- The Secure Snapshot Share wiring is
  `doSecureShare` in `src/js/main.js:1071`, invoking
  `anonymize_snapshot` (sync, in the SYNC_ALLOWLIST).
- The story knowledge base lives in
  `community/stories/{generic,n55}.toml`; tests load it
  via `story::load()`.

* fix(ci): handle stacked PRs in autonomous auto-merge job (#204)

* Initial plan

* fix(v0.14.4): handle stacked PR auto-merge in CI

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Initial plan (#206)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ohgeecee <ohjoncurrie@gmail.com>

---------

Co-authored-by: ohgeeceee <ohgeeceee@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants