Task: Guard the shell's command units

Table of Contents

This page documents a task in the Standardise the curve configuration's parameters on the one contract story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

Make a repeated command registration fail a check, not the first shell a person opens. The shell is how a tenant is provisioned, so a start-up break stops every test that needs a tenant.

2. Status

Field Value
State DONE
Parent story Standardise the curve configuration's parameters on the one contract
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-30

3. Acceptance

  • A check reports a unit an aggregator registers twice.
  • A check reports a menu name two units build.

4. Plan

1. State the guard's two rules over the source: one unit builds one menu name,
   and one aggregator names each unit once.
2. Wire the check into the local checks, so a pull request runs it.
3. Prove it on the merge that broke the shell and on main, which is clean.

5. Measurements

Every number this task claims about a tree, with the command that produced it and the commit it was measured at. A number without both is not a measurement, because a clean-up record describes a tree and trunk moves under a branch: a consumer count, a gate's component count and a suite's size all change with no code changing, and the reader of a bare number cannot tell which tree it came from. Where the raw output matters, put it in an evidence/ file beside the task and name that file in the Command column.

What Value Command Commit
Files the check reads 478 python3 build/scripts/check_shell_command_units.py projects/ores.shell this branch
Problems on main 0 as above 91f66308dd
Problems in the merge that broke the shell 1, legal_entity_commands registered twice as above, on the file main carried before #4107 ffcf0a5baa
Cost of the check 0.3s compass check --exclude-heavy --only shell-command-units this branch

6. Notes

20a6ec0707 and ef5800d37a each wired the legal entity unit, from two branches, and #4107 removed the second registration from main. The guard that raised the error already lived in shell_root_menu, so the defect was known and stated; what was missing was a reader of that statement before start-up.

The check skips a tests directory, because a test file registers a unit once per test case, into a menu of its own.

7. Result

Two rules now run on every pull request: a menu name is built by one unit, and an aggregator names each unit once. The check reports the merge that broke the shell and reports nothing on main.

8. Test Scenarios

Manual QA scenarios (scaffolded via compass add test_scenario) that verify this task. Link new ones here as they're created; the scenario doc itself links back via its "Verifies task" field.

Scenario State Notes
     

9. PRs

PR Title
#4109 [agile] Record the walk on a freshly provisioned tenant
#4108 [shell] Check that each command unit is composed once

10. Review

Comment summary File Decision Notes
       

11. Result

Emacs 29.3 (Org mode 9.6.15)