Skip to content

Electrical report: multi-robot export, readiness, and web snapshots - #432

Open
tblank1024 wants to merge 31 commits into
mainfrom
ElectricalWeb
Open

tblank1024 wants to merge 31 commits into
mainfrom
ElectricalWeb

Conversation

@tblank1024

Copy link
Copy Markdown
Contributor

Summary

Changes to the electrical report tool so the electrical web tool
(https://team488.github.io/electrical-contract-web/) can show every robot the code can run on, and pick up contract changes automatically.

  • One report per robot. ./gradlew electricalReport --args="--contract NAME [--json] [-f FILE]", where NAME is a ContractToUse value: Competition, 2025, 2023 or Robox. The default is Competition. The names come from the CONTRACTS map in electrical/report/Main.java, which mirrors the switch in competition.Robot.
  • Readiness. The new @ReadyWhen(Hardware.X) annotation goes on the ElectricalContract getters. Devices whose mechanism isn't in the contract's readiness set are left out of the report and listed under "Not on this robot". The drive follows isDriveReady() and the CANcoders follow areCanCodersReady(). Robot behavior is unchanged; the annotation is only read by the report tool.
  • JSON snapshot (--json) for the web tool. It includes each device's declaring class (for example GeneralContract), the disabled list, and the contract and robot names.
  • Report-only wiring lists (CAN order, extra PDH loads, power branches) are only used when the robot's own contract class declares them. So RoboxContract no longer reports the 2026 robot's wiring.
  • New GitHub Action, Electrical snapshots. On pushes to main that touch the contracts or the exporter, it exports every contract and publishes the JSON to the electrical-snapshots branch. The web tool reads it from there, with no secrets and no manual step.
  • Docs: plan_Ele_contract.md (the end-state design and how to run it) and plan_electrical_web.md (the design history).

Things for reviewers

  • Climber readiness. The 2026 report now lists the climber motors and sensor under "Not on this robot", because Contract2026's readiness set leaves out ClimberLeft, ClimberRight and ClimberSensor. Is the climber really off the robot?
  • Contract2025 turns off the drive and every mechanism, so its report has no devices. Is that intended?
  • Contract2023 names its steering motors with getDriveControllerName(), so each corner has two …/Drive motors. This is the same bug Fix bug with steering motors getting drive names, shadowing the drives #387 fixed for 2026.
  • Local PDHPort copy. This branch has src/main/java/xbot/common/injection/electrical_contract/PDHPort.java, which extends SeriouslyCommonLib's enum to PDH00–PDH23. It shadows the library class. If the SeriouslyCommonLib version main builds against already has PDH20–23, the copy can be deleted.

After merging

In Team488/electrical-contract-web, change snapshotSource in infra/cdk.json from .../electrical-snapshots/ElectricalWeb to .../electrical-snapshots/main, then run cdk deploy. That way the web follows main.

Testing

  • ./gradlew build passes, with checkstyle and the 4 unit tests.
  • The exporter was run for all four contracts. The 2026 text report differs from the old one only by the readiness filter.
  • The Electrical snapshots Action ran on this branch, and the live web tool imported its output automatically.

🤖 Generated with Claude Code

https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp

tblank1024 and others added 22 commits February 19, 2026 14:45
…ysis and Electrical Report. Added Main.java files for both Electrical Analysis and Electrical Report. Updated build.gradle to include new tasks for running the Electrical Analysis and Electrical Report.
…es that are relevant to electrical group only
Covers split data ownership (Java for code-consumed fields, D1 for
electrical-only data), optimistic-concurrency edits, passcode login,
GitHub Pages + Cloudflare Workers/D1 hosting, migration steps, and the
decisions on all open questions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
Replaces the migration-step list with phases 1-4; phase 1 (local demo)
marked done, with notes on where it differs from the original data model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
`./gradlew electricalReport --args="--json"` writes a machine-readable
snapshot for the electrical web tool, using the same discovery as the
text report (text output unchanged). Rename Pigeon2()/CANdle() to
getPigeon2()/getCandle() so checkstyle passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
Conflicts: contract files take main's versions (main already has the
#139 squash of ElectricalChecks plus the GeneralContract refactor and
lowercase pigeon2()/candle()); electrical/report/Main.java keeps this
branch's version (main's #139 copy plus the --json export).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
main renamed the DIO devices (ClimbHomeDIO -> ClimberSensor), so the
name-suffix rule missed them. Treat non-CAN DeviceInfo powered from the
RIO as DIO too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
Backend moves from Cloudflare Workers + D1 to Lambda (Function URL) +
DynamoDB, deployed with AWS CDK. Adds phase 1b to port the local demo
backend, DynamoDB single-table model with transactional versioned
writes, cost guard rails, and OIDC-based CI deploys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
… tool

Describes how the system works after all phases: data ownership
(Programming vs Electrical), data model, concurrency, startup, how
changes get back into Java, SystemCore controller profiles, what is
not built yet, and how to run it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
- electricalReport takes --contract (Competition, 2025, 2023, Robox),
  matching the ContractToUse switch in competition.Robot.
- New @ReadyWhen(Hardware) on contract getters; devices whose mechanism
  isn't in the contract's readiness set are left out and listed under
  "Not on this robot". Drive and CANcoders follow isDriveReady() and
  areCanCodersReady().
- Snapshot JSON records contractName, robotName, each device's
  declaring class (definedIn) and the disabled list.
- Report-only wiring lists are used only when the robot's own contract
  class declares them (Robox no longer inherits the 2026 wiring).
- plan_Ele_contract.md: multi-robot design (section 3.1) and new
  not-built items.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
On push to main or ElectricalWeb (contract or exporter changes), export
every robot's contract as JSON and publish it to the
electrical-snapshots branch, where the electrical web tool reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
@tblank1024
tblank1024 requested a review from a team November 1, 2026 00:18

@aschokking aschokking left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this shows the proof of concept. The PDHPort change should go into SeriouslyCommonLib, probably the ReadyWhen idea as well. The contract and workflow should end up in FRCRobotTemplate so they could get picked up when we create 2027 this year?

tblank1024 and others added 6 commits November 3, 2026 17:38
… FRCRobotTemplate

Adds §10.1 (where each piece lives from 2027, landing order, 2026 unchanged)
and the follow-up items in §11.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
What moved to SeriouslyCommonLib (#692) and FRCRobotTemplate (#96), the API
of the new interface and exporter, how it was checked, landing order, setting
up the 2027 repo, and the contract-name clash with 2026 robots on the web.
Updates the header, architecture, readiness, startup and run sections to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
…picker

Replaces the open contract-name clash with the repo + contract design (§3.1,
§4, §8.1, §12.3, §13.6) and adds the wiring-copy follow-up to §11.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
…ed-mechanism open item

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
…-web; ignore electrical-report.txt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
tblank1024 and others added 3 commits November 5, 2026 08:07
…#688

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
…mpetition count

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
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.

3 participants