Skip to content

diff -o sh: the script says where it came from - #10

Merged
ppietikainen merged 1 commit into
mainfrom
sh-provenance
Nov 19, 2026
Merged

ppietikainen merged 1 commit into
mainfrom
sh-provenance

Conversation

@ppietikainen

Copy link
Copy Markdown
Member

An firru diff -o sh script now starts with # lines saying what produced it:

# firru diff -o sh
#   from:     policies/r1-synthesized/xroad-securityserver_bgp_05_berylia_org.yml
#   to:       policies/r2-tightened/xroad-securityserver_bgp_05_berylia_org.yml
#   to says:  firru tighten output — review and copy changes to policies/pol/…
#             Flows: night.jsonl, 2024-03-06T17:00:00Z to 2024-03-07T05:59:58Z
#             Source suggestions changed: 3 | Dead rules: 0 | Group suggestions: 0
#   evidence: none (no --flows given)
  • "to says" is the proposal's own header, so a tightened policy's flow window travels into the script.
  • "evidence" records what diff itself used: --flows, --zero-evidence, or none.
  • The header is built from the inputs only, never a time or a version, so the same diff writes the same script.
  • The header contains none of the words people filter on (narrowed, observed and so on), so grep narrowed | sh still takes only commands. Comment lines are skipped by both sh and firru mass.

Three new tests cover the content, staying out of a grep and of firru mass, and determinism. The committed examples are unchanged.

🤖 Generated with Claude Code

An -o sh script starts with '#' lines saying what made it: the two files,
the proposal's own header (tighten writes its flow window there), and the
evidence diff used (--flows, --zero-evidence, or none). Inputs only, never
a time or a version, so the same diff writes the same script; and none of
the class or evidence words readers grep for, so `grep narrowed | sh`
still takes only commands. A shell and `firru mass` skip the lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ppietikainen
ppietikainen merged commit 3be34dc into main Nov 19, 2026
6 checks passed
@ppietikainen ppietikainen mentioned this pull request Nov 19, 2026
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