Skip to content

chore(agents): verify-ftw skill that drives Core with the simulators - #1678

Merged
frahlg merged 3 commits into
masterfrom
agent-plan/verify-ftw-skill
Oct 17, 2026
Merged

frahlg merged 3 commits into
masterfrom
agent-plan/verify-ftw-skill

Conversation

@frahlg

@frahlg frahlg commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Add a verification skill for Core with the Ferroamp and Sungrow simulators. The helpers share a Python runner that records process identity, checks API-port ownership before each request, refuses occupied ports and existing scratch state, and stops its children when startup fails. Cleanup checks process identity before signalling and keeps evidence.

The supported automated journey is idle. It requires both named batteries exactly once in dispatch and feedback, accepted 0 W commands, fresh readings, and command and observation times after this action. Empty feedback, one missing battery, stale evidence or another process owning the API port must fail. Other modes need their own assertions; stale-driver fallback remains a manual journey.

Validation:

  • Eight helper tests, including negative cases and a real local ps/lsof listener check. CI runs these tests on macOS and Linux.
  • Skill frontmatter validation and bash -n for all four entry points.
  • macOS arm64 with Go 1.27.1: launch → doctor → idle → cleanup passed with both simulators healthy. Both batteries received 0 W; all five ports closed after cleanup and the request, response, status and Core-log evidence remained.
  • make verify passed on the shared Go base in ci: run the Go race detector on the control-loop packages #1676; this PR changes no Go or product code.

The helper tests run in CI. The complete simulator journey above is a local run, and no hardware behaviour follows from it. .verify-evidence/ stays gitignored. Nothing in this skill ships to users, so no changeset is needed.

Part of #1679. Remains draft for the owner's merge decision.

…ators

Agents claim behaviour from reading code or from tests that pass. This
skill gives them one scripted way to start Core with the Ferroamp and
Sungrow simulators on isolated ports and an empty state directory, drive
a feature through the public API, and keep the evidence.

launch.sh waits for live driver telemetry, doctor.sh checks the instance
is ours, drive-mode.sh proves the idle journey down to the power sent to
each battery, and cleanup.sh stops only the pids it started. The feature
map seeds live status, mode and stale-driver fallback.

Proved end to end on this branch: launch, doctor, drive-mode idle,
cleanup, evidence kept. .cursor/ joins the changeset allowlist because
nothing in it ships to users.
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg marked this pull request as ready for review October 17, 2026 05:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T05:54:15.252903Z f47aa0c Draft marked ready
ℹ️ 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.

@frahlg
frahlg merged commit 592b8ee into master Oct 17, 2026
17 checks passed
frahlg added a commit that referenced this pull request Oct 17, 2026
…1679)

* docs: propose a stepwise plan to make FTW safe for agents to change

Agents write most of FTW, and review bots raised 1,150 findings on 573
of their pull requests. This plan groups those findings into recurring
mistake classes, proposes a structural fix for each at the highest level
that works, backtests each fix against the history, and orders the fixes
into independently mergeable steps. Steps 1, 2 and 4 are draft PRs
#1676, #1677 and #1678.

tools/agent-pitfalls holds the script and the labels so a reviewer can
rerun or spot-check every number.

* docs: keep the pitfall lever under docs/ so the PR stays docs-only

* docs: distinguish model estimates from executable evidence

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>

---------

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f47aa0c1ab

ℹ️ 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".

("path: ../dev-data/state.db", f"path: {self.run}/data/state.db"),
("lua: drivers/", f"lua: {self.repo}/drivers/")]:
require(old in config, f"simulator config is missing {old!r}")
config = config.replace(old, new)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid reprocessing substituted port values

When an override equals a placeholder processed later—for example, FTW_VERIFY_MQTT_PORT=8887 with a distinct custom OCPP port—this sequential global replacement first writes port: 8887 into the MQTT block and then replaces it again while processing the OCPP placeholder. Core consequently connects to the OCPP port instead of the simulator's MQTT port, so an otherwise valid documented port configuration never becomes ready. Replace only the intended YAML fields or derive the generated config structurally.

Useful? React with 👍 / 👎.

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.

1 participant