@jawache/flow 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -70,7 +70,7 @@ flow init — created:
70
70
  + .githooks/pre-commit
71
71
  + .flow/ — flow's own state, self-ignoring, never committed
72
72
  + node_modules/@jawache/flow → …/flow (a link to the flow that is running — nothing here resolved @jawache/flow)
73
- + ~/.claude/settings.json — SessionStart · PreToolUse · PostToolUse · Stop
73
+ + ~/.claude/settings.json — SessionStart · PreToolUse · PostToolUse · PostToolUseFailure · Stop
74
74
  + git config core.hooksPath .githooks
75
75
  next: `flow status` — what is bound, and what is not wired yet.
76
76
  ```
@@ -83,7 +83,7 @@ Six things, and each one is checkable:
83
83
  | `.githooks/pre-commit` | the commit gate. Never written over one you already have |
84
84
  | `.flow/` | flow's own state and logs. It ignores itself, so your `.gitignore` is untouched |
85
85
  | `node_modules/@jawache/flow` | a link to the flow that is running, because this folder resolves no `@jawache/flow` of its own. `npm i -D @jawache/flow` and this row disappears |
86
- | the host's `settings.json` | four hook registrations, so a coding agent in any repo asks flow first |
86
+ | the host's `settings.json` | five hook registrations, so a coding agent in any repo asks flow first |
87
87
  | `core.hooksPath` | what makes git run the gate. It is per-clone, so every fresh checkout runs `flow init` |
88
88
 
89
89
  `flow init --empty` gives you the same wiring with no opinions, for a repo that knows what it wants.
@@ -103,7 +103,7 @@ flow is ON — 4 guardrails · 2 breadcrumbs, every one resolved and able to fir
103
103
  categories subagent — what the entries below bind to
104
104
  session
105
105
  🍞 flow.orientation
106
- This repo is guarded by flow. Guardrails block risky edits before they land (and again at commit); …
106
+ This repo is guarded by flow. Guardrails are rules that refuse a change, and every change to the fi…
107
107
  touch
108
108
  🍞 flow.editingTheGuardrails — on flow.config.ts .claude/settings.json .claude/settings.local.json .claude/agents/** .claude/skills/**
109
109
  You are editing the guardrails themselves. If this edit weakens, disables or removes a guardrail or…
@@ -121,7 +121,7 @@ flow is ON — 4 guardrails · 2 breadcrumbs, every one resolved and able to fir
121
121
  ✓ config: /tmp/flow-demo/flow.config.ts
122
122
  ✓ commit-gate: .githooks/pre-commit runs `flow commit` over the staged set
123
123
  ✓ hooks-path: core.hooksPath = .githooks
124
- ✓ hooks: ~/.claude/settings.json — SessionStart · PreToolUse · PostToolUse · Stop
124
+ ✓ hooks: ~/.claude/settings.json — SessionStart · PreToolUse · PostToolUse · PostToolUseFailure · Stop
125
125
  green — every rule loads, every fitting is in place.
126
126
  ```
127
127
 
@@ -140,7 +140,13 @@ orientation breadcrumb is injected into the session as context, before the agent
140
140
  **2 — a banned command is refused.** Ask the agent to force-push the branch. It is stopped
141
141
  *before the command runs*, with the rule's own sentence, and there is no way around it.
142
142
 
143
- **3 — the commit gate holds.** Have the agent write a file containing the literal marker
143
+ **3 — a shell edit is refused too.** Ask the agent to add a `TODO` to a guarded file with a
144
+ heredoc or `sed -i` instead of the Edit tool. The write goes through, so the file on disk changes.
145
+ The same rule then checks it, and flow puts the file back to the content it had before. The refusal
146
+ is printed beside the command's own output. Notice that a refused write never stays, whichever tool
147
+ made it.
148
+
149
+ **4 — the commit gate holds.** Have the agent write a file containing the literal marker
144
150
  `DO`-`NOT`-`COMMIT` (spelled whole), stage it, and commit. Git refuses at the hook, naming the rule
145
151
  and the file. Take the marker out and the same commit lands.
146
152
 
@@ -238,9 +244,9 @@ Six things to know, and then you can write your own:
238
244
  | moment | when | guardrail | breadcrumb |
239
245
  | --- | --- | --- | --- |
240
246
  | `session` | a chat starts, resumes, or is compacted | — | ✓ |
241
- | `touch` | a tool call names a file | — | ✓ |
242
- | `write` | a file is about to be written | ✓ | — |
243
- | `delete` | a command is about to remove a file | ✓ | — |
247
+ | `touch` | a tool call names a file, or a shell command reads a file | — | ✓ |
248
+ | `write` | a file is created or changed. A write from the Edit tool is checked before the file changes; a write from a shell command is checked the moment it has changed. A refused write is undone | ✓ | — |
249
+ | `delete` | a file is removed. An `rm` is checked before it runs; any other removal is checked the moment the file is gone. A refused delete puts the file back | ✓ | — |
244
250
  | `command` | a shell command is about to run | ✓ | — |
245
251
  | `commit` | git's pre-commit hook, over the staged set | ✓ | — |
246
252
  | `turn-end` | the agent is about to hand back | ✓ | — |
@@ -301,7 +307,7 @@ flow guards itself: `flow.config.ts` at the root binds the ten packs above throu
301
307
  `guards/house.ts`. A door that stops exporting, a rule that stops loading or a bundle that stops
302
308
  building refuses this repo's own next commit first.
303
309
 
304
- Longer documentation is in [`docs/user/`](docs/user/index.html): the guidebook, the five-minute
310
+ Longer documentation is in [`docs/user/`](docs/user/index.md): the guidebook, the five-minute
305
311
  quick start, the config reference, how to author a pack, and one page per stock check.
306
312
 
307
313
  ## Licence