Skip to content

Commit edb87e7

Browse files
committed
docs(incident): stop promising byte-for-byte fidelity the command no longer offers
The card said the command 'exits non-zero if the stored text doesn't match the file byte-for-byte'. That stopped being true when the comment text started being trimmed before the write: leading and trailing whitespace never reaches storage, so an agent following the card's own heredoc idiom would be promised a fidelity the command deliberately does not provide. State what actually holds instead — the write is verified, surrounding whitespace is stripped on both ends, everything else including interior blank lines survives. The guidance test pinned that exact sentence, so it was keeping the false claim in place. Assert the property instead: the guarantee must be documented (read-back + non-zero exit), and the byte-for-byte promise must NOT come back. Verified load-bearing - restoring the old sentence turns the new assertion red.
1 parent 0dd4678 commit edb87e7

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

internal/skilldoc/incident_comment_guidance_test.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,19 @@ func TestIncidentCardCommentWorkflow(t *testing.T) {
4141
if strings.Contains(body, "read back every target and verify the intended comment is present before reporting success") {
4242
t.Error("incident card must not retain the manual read-back workaround now that the CLI verifies content fidelity itself")
4343
}
44-
if !strings.Contains(body, "exits non-zero if the stored text doesn't match the file byte-for-byte") {
45-
t.Error("incident card must document the command's own read-after-write content-fidelity guarantee")
44+
// Assert the guarantee is documented, not the sentence that documents it:
45+
// pinning a full sentence turns this check into a checksum that goes red on
46+
// every reword and teaches the next reader to update the literal reflexively.
47+
if !strings.Contains(body, "reads back") || !strings.Contains(body, "exits non-zero") {
48+
t.Error("incident card must document the command's own read-after-write verification — that is what replaced the manual read-back step removed above")
49+
}
50+
// The CLI trims leading/trailing whitespace before sending, because the
51+
// server trims it too, so the stored text is deliberately NOT the file's
52+
// exact bytes. The card used to promise byte-for-byte fidelity against the
53+
// file; that claim is false and would set an agent up to expect trailing
54+
// newlines to survive a heredoc write.
55+
if strings.Contains(body, "match the file byte-for-byte") {
56+
t.Error("incident card must not promise byte-for-byte fidelity against the file: leading/trailing whitespace is stripped before the write")
4657
}
4758
}
4859

skills/flashduty/reference/incident.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fduty incident resolve <incident-id> --root-cause "DB primary failover delay" --
7373

7474
Projected `similar` lists stay below 16 KiB, and projected `detail --fields` output stays below 8 KiB. A trailing `...` means a long retained string was shortened; omit `--fields` only when the full unbounded detail is explicitly required.
7575

76-
`comment` never accepts the text as a command-line argument — only `--comment-file <path>` (or `--comment-file -` to read stdin), so backticks/`$()`/quotes inside the comment are inert. The command also reads back every target's timeline after writing and exits non-zero if the stored text doesn't match the file byte-for-byte, so `Commented on ...` is proof of content fidelity, not just acceptance — no separate manual read-back is needed.
76+
`comment` never accepts the text as a command-line argument — only `--comment-file <path>` (or `--comment-file -` to read stdin), so backticks/`$()`/quotes inside the comment are inert. The command also reads back every target's timeline after writing and exits non-zero unless it finds an entry matching what it sent, so `Commented on ...` is proof of content fidelity, not just acceptance — no separate manual read-back is needed. Leading and trailing whitespace is stripped before sending (the server strips it too, so this is what gets stored); everything else, including interior blank lines, is preserved exactly.
7777

7878
> `incident list --output-format json|toon` defaults to the compact row projection `incident_id,title,incident_severity,progress,start_time,channel_id`. Pass `--fields incident_id,title,channel_id,start_time` when you need different list columns; use `incident detail <id>` / `incident get <id>` for full incident records.
7979

0 commit comments

Comments
 (0)