Repository navigation
[Air #1840] feat: afx decisions init turns on the Decisions tab - #1841
Conversation
Creates the decisions file from its template at --path, else dashboard.decisionsFile, else codev/state/pending-decisions.md, held to the tab's own containment rule, and refuses a file that already exists. The template is a code constant; the protocol doc's section 4 is pinned to it. Architect role and the Decisions tab docs name the command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Print the --path config hint as nested JSON, refuse a dashboard.decisionsFile the tab refuses even when --path is given, word the EEXIST refusal for any existing path, and list the command in the agent-farm command reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you — this is the command the tab was missing, and it is built the right way: the path rule is delegated to the tab's own resolver so the two can never disagree, and the One line before merge: add Not for this PR: the |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
afx decisions initis the one command an owner runs to start using decisions. It writes the decisions file from its template, prints where the file went, says that the Decisions tab appears within a few seconds, and gives the one sentence to tell the architect: "Route every ask for my word through the decisions file."Closes #1840
What Changed
servers/decisions/template.tsexportsDECISIONS_FILE_TEMPLATE, which is the file Fix #1836: Decisions tab reads time-only and missing stamps without a warning #1837 ships.decision-protocol-doc.test.tsasserts that section 4's fenced template equals it, and that section 4 names the command above the template, so the doc and the code cannot drift.commands/decisions.tsplus its wiring incli.ts. The target is--path, elsedashboard.decisionsFile, elsecodev/state/pending-decisions.md. Resolution and containment reuse the tab's ownconfiguredDecisionsPathandresolveDecisionsPath, so a path the tab would refuse (.., or a symlink out of the workspace) is refused here with the same rule. The command createscodev/state/if it is missing. The write usesflag: 'wx', so an existing file is refused, and so is a directory or a dangling symlink at that path. Nothing is ever overwritten, and there is no--force.### afx decisions initentry in the command reference. The Decisions tab section ofagent-farm.mdnow opens with the command as the way to turn the tab on. Section 4 ofdecision-protocol.mdnames the command above its template. The architect role says to runafx decisions initand follow the doc when the owner asks to use decisions. That section stays three lines, as the issue asked.Key Decisions
--pathmust be relative, the same rule asdashboard.decisionsFile, so the printed path can be pasted into config as is. An empty--pathis refused too.--paththe tab does not read gets an honest message. The tab reads only the configured path. So when--pathdiffers from it, the command does not claim the tab will appear. It prints the setting that would show the file instead, as nested JSON:{"dashboard":{"decisionsFile":"<path>"}}. The command does not write config, because the issue does not ask for that.dashboard.decisionsFilethe tab refuses fails the command loudly, even with--path. That covers an absolute path, a value that is not a string, and a path resolving outside the workspace. The command reports the tab's own error rather than falling back to the default._Status:then_Zone:, which is what Fix #1836: Decisions tab reads time-only and missing stamps without a warning #1837 shipped and what the existing doc test pins.Test Plan
decisions-init.test.ts, 8 tests). They cover: creatingcodev/state/and the file from the template, after whichdecisionsFilePresentis true and the file parses with no problems; refusing an existing file and leaving it byte-identical; honouringdashboard.decisionsFile;--pathwinning over config; refusing a path outside the workspace, whether through.., a symlinkedcodev/state, or a config.., with nothing written; refusing an absolute or empty--path, an absolute config value, and an out-of-workspace config even when--pathis given; and the printed output for both the default case and a--paththe tab does not read.DECISIONS_FILE_TEMPLATE. The Decisions tab section in both trees opens with the command, and the architect role in both trees names it.decisions-tab.test.ts). With a dashboard already open on a workspace that has no decisions file, the test runs the builtbin/afx.js decisions initin that workspace. The Decisions tab appears in about 2 s, and a page-scope marker set before the command shows the page was not reloaded. The tab showscodev/state/pending-decisions.md,0 open, and "No open decisions." I looked at the screenshot. The whole Decisions suite passes (12/12) on an isolated test Tower (port 14101, throwaway state and socket dirs).--path ../out.md,--path notes/owner.mdwith the config hint, andafx decisions --help.packages/codevsuite passes (6526 passed, 48 skipped).CMAP
gemini=APPROVE, codex=REQUEST_CHANGES, claude=COMMENT. All points that held up are fixed in the second commit:
--pathhint printed what reads as a flat config key. It now prints nested JSON.--pathwas given. It now is, the same as an absolute config.afx decisions initto the command reference in both trees. The refusal message for an existing path no longer claims a directory "holds the owner's rulings"..claudeand.codex, in both trees.Review Notes
The
--pathmessage is the one behaviour not spelled out in the issue (see Key Decisions). Without it, the command would claim the tab appears when it would not.🤖 Generated with Claude Code