agentleFS
AncienttwoAncienttwo/repo-harness/.claude/skills/verify-boss-command/SKILL.md

verify-boss-command

Skill436 starsChanged 24 days agoMITView on GitHub

TLA+ model checks of the boss command send: the operator write run and the cooldown from the audit log. Use before you change src/effects/operator/write-run.ts, src/effects/operator/advisor-seat-route.ts, src/effects/operator/write-audit.ts, src/core/board/advisor-seat.ts, src/effects/operator/board-read.ts or src/effects/operator/server.ts.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. aimpact-inc/repo-harness★ 436100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository7 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read each counterexample as a path through the actions in the spec header.

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Verify the boss command

A boss command is a console write into an agent terminal. BossCommandSend.tla describes the server code at the sync commit: the target lock, the request lookup, the intent record, the cooldown, the read-back, the send child, the result record, and one crash of operator serve at a step boundary.

Sync commit: b9dee51ee0390b300951123607144d680add2339 (PR base). Move it forward only after each row of the coverage record is true for the new code.

What is checked

RuleSentenceHarm when it breaksState
CooldownHoldsTwo requests that reached the seat have intent times at least one cooldown apart.The advisor seat gets the same command two times inside 30 or 60 minutes.holds
OneSendPerRequestOne request_id reaches the seat at most one time.A retry types the command into the terminal again.holds
IntentBeforeSendNothing is sent before the intent record is in the log.A send that no log entry can account for.holds
HonestAnswerAn answer that says "not sent" is true, and an answer 200 has a send.The person sends again after a false "not sent".holds

Coverage record

Model partCode
Admit: the lock, the lookup, the intentsrc/effects/operator/write-run.ts:145-171
IdempotentAdmissionwrite-run.ts:152-153
Admit: the cooldownsrc/effects/operator/advisor-seat-route.ts:141-158,193-205
UnresolvedCounts, ReconcileCountsmaySend, advisor-seat-route.ts:126-131
ReadBackadvisor-seat-route.ts:207-222
ChildFailsADVISOR_SEAT_NOT_SENT, src/core/board/advisor-seat.ts:55-59
SendReturns, SendTimesOutadvisor-seat-route.ts:65-100, src/effects/operator/board-read.ts:172-181
Recordwrite-run.ts:181-197

Admit is one step of the model because the lookup, the intent append, the read of the log and the cooldown decision run with no await between them. A change that puts an await there makes the model wrong: split the step before you run the check.

A change touches the verified code when git diff b9dee51ee0390b300951123607144d680add2339 -- src/effects/operator/write-run.ts src/effects/operator/advisor-seat-route.ts src/effects/operator/write-audit.ts src/core/board/advisor-seat.ts src/effects/operator/board-read.ts src/effects/operator/server.ts is not empty.

Run

TLA2TOOLS_JAR=<tla2tools.jar of TLA+ v1.7.4> bash specs/tla/check.sh BossCommandSend

The run takes about 10 s and needs Java 11 or later. The script takes the version and the SHA-256 of the jar from scripts/contract-closeout-tla.sh. specs/tla/checks.tsv holds the expectation of each config: holds, breaks (one guard is off, and TLC must report the named rule) or finding (the code breaks these rules now).

Bounds of BossCommandSend.cfg: one binding, three calls (two with one request_id), a cooldown of 2 clock ticks, a clock of 0 to 3, one crash: 72,018 states.

Read each counterexample as a path through the actions in the spec header. BossCommandSend.tla has more states than a chart can show.

Change the code

  1. Find the changed lines in the coverage record and in the header of the spec.
  2. Change the model first, from the code: the action, or the constant of the guard. Do not shape it by the result.
  3. Run the check.
    • A holds config fails: replay the counterexample against the code, one step for each action. When each step can occur, the change has a bug. When a step cannot occur, the model is wrong: correct the model and say what was wrong.
    • A breaks config passes: the model lost the ability to fail. Find the guard in the new code and model it.
    • A finding config holds: the change repaired the finding. Set its row in checks.tsv to holds and name the PR.
  4. Set the sync commit to the commit that you checked.

Evidence at the sync commit

The tests catch each of the three guard removals: tests/cli/operator-serve.test.ts (boss commands) fails for both changes of maySend, and tests/effects/operator-write-channel.test.ts fails with the request lookup off. The model adds the crash at each step boundary and each order of three calls.

Assumptions

  • A child that reports a code of ADVISOR_SEAT_NOT_SENT did not run hc send.
  • A send child can outlive a crashed server and send later.
  • The target lock gives mutual exclusion between live runs, and a dead owner loses it. The lock code (src/effects/locking/exclusive-directory-lock.ts) is not in the model.
  • An append to the audit log is complete or absent, and the clock does not go back.

Not covered

  • The free-text message route, which shares the target lock, and two sends that reach one seat at the same time.
  • Two operator serve processes on one home.
  • The text of a command, and the advisor after it gets the text.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.