geneseed 5.5.1 → 5.6.0

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/CHANGELOG.md CHANGED
@@ -8,6 +8,13 @@ label. For the capability ↔ spec map, see [SHIPPED.md](SHIPPED.md).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [5.6.0] — 2026-11-17
12
+
13
+ ### Changed
14
+
15
+ - **Catching your own branch up with its base no longer asks.** Off the main branch, the commit gate now accepts a plain `git fetch` in the same command as your commits, merges and pushes, so `git fetch origin && git merge origin/main && git commit … && git push origin <branch>` goes through in one piece. A fetch into a local branch (`origin main:main`) or one with an option that runs a program (`--upload-pack=`) still asks. A Foreman worker's local merge in its own worktree may fetch first too.
16
+ - **Commits stop asking because of how the message is written.** Claude Code tends to commit with `-m "$(cat <<'EOF' … EOF)"`, and the gate cannot see inside a `$(`, so every such commit asked, even on your own branch. The commit skill now says to pass a body as `git commit -F - <<'EOF'` with the delimiter quoted, a form the gate already reads. The docs say why the other form asks.
17
+
11
18
  ## [5.5.1] — 2026-11-17
12
19
 
13
20
  ### Added
package/SHIPPED.md CHANGED
@@ -20,7 +20,7 @@ historical references, not files distributed with the repo.
20
20
  > **On version numbers.** [`harness.config.json`](harness.config.json)'s `version` is a
21
21
  > human-readable label only. The canonical identity of an installed harness is the
22
22
  > **source fingerprint** stamped in `.geneseed-version` (see `geneseed version`), not the
23
- > string. Current label: **5.5.1**.
23
+ > string. Current label: **5.6.0**.
24
24
 
25
25
  ## Capabilities
26
26
 
@@ -24,7 +24,7 @@ silently guarding the wrong rule after a renumber. See [ADR 0005](../adr/0005-st
24
24
  | `sealed-secrets` | law | ask: rule-gate (credential-shaped content outside `.env*`). Switchable per install with `--no-secrets-gate` (see [Exclusions](exclusions.md)): this scan stands down on every host, the guard plugin's path block included | same as Claude Code | block: guard plugin (key/credential file path, or vendor-prefixed secret content); warns only on `.env*` | block (exit 2) |
25
25
  | `deletion-is-deliberate` | law | ask: git-gate, only on real data loss judged against the repository's state (the list in [Hooks](hooks.md): a protected branch deleted or force-pushed, an unpushed unmerged branch deleted, unpushed commits abandoned by `reset --hard`, uncommitted work discarded other than by `reset --hard`, a stash dropped, the reflog pruned, files git cannot restore removed); asks when it cannot verify. Switchable per install with `--no-deletion-gate` (see [Exclusions](exclusions.md)): the real-loss check and the Law IV `permission.bash` keys stand down, everything else in this table stays **+** ask: git-gate, catastrophic shell (`rm -rf` of `/`, a drive root or `~`, `mkfs`, `dd` over a raw disk, `format`, fork bomb), whatever the state and even with the switch off | same as Claude Code | ask: permission prompt (`git reflog expire*`, `git gc --prune*`, a force push or delete of `main`/`master` by name) **+** block: guard plugin (catastrophic shell, the hook's check plus its own stricter text match: `rm -rf` of `/`, a drive root or `~`, fork bomb, `format`, `dd` over a raw disk) **+** block: guard plugin (every other real-loss case, the same state-aware decisions as the hook) | block (exit 2) |
26
26
  | `persist-insight` | process | ask: rule-gate (a write to `user-rules.md` or `user-rules.draft.md`; memory is written freely, and the [change report](hooks.md#the-change-report) and the web console show it). Togglable: build without the process pack, or drop this rule alone with `--exclude-rules`: the hook goes on every host (`--no-rule-store`), OpenCode's `permission.edit` keys on the rule files too. The change report still lists rule-file changes | same as Claude Code | ask: OpenCode's own prompt (`permission.edit`, and `evaluate` on OpenCode 2); the guard plugin refuses a file-tool write the host cannot prompt for | block a file-tool write: exit 2, no ask tier; a parsed shell write only warns |
27
- | `consent-before-push` | process | ask: git-gate, on a commit or push onto the main branch (`main`, `master`, a remote's default branch, or the branch the main checkout holds when the command runs in a linked worktree). Off the main branch, a session's commit, local merge and plain push of the checked-out branch (`git push [-u] <remote> <branch>`, or `HEAD:<branch>`) pass. A bare `git push`, a push of another branch, a forced push, a tag push, or any form the gate cannot read still asks, and so does everything in a repository with no remote or whose remote has no default branch recorded (`git remote set-head origin --auto`). A sub-agent's push always asks. With `--strict-consent` (the *Strict consent* switch on the console's Constitution page), every commit and push asks again, as before 2026-11. A sub-agent's commit or merge (`agent_id` in the payload) in a linked worktree, on a branch that is not shared, passes: a Foreman worker's own batch ([Foreman mode](foreman-mode.md) has the exact conditions). A git hook or `core.hooksPath` that pushes on commit is not seen. A push, or a command that mixes one in, still asks. Togglable: build without the process pack, or drop this rule alone with `--exclude-rules` (see [Exclusions](exclusions.md)). Only this question drops; the `deletion-is-deliberate` gate stays. | same as Claude Code | ask: permission prompt (`git commit*`/`git push*`), wired only when the process pack is on; a `loop/*` push is statically allowed. A glob sees only the command, never the worktree, so a worker's commit still asks | log only |
27
+ | `consent-before-push` | process | ask: git-gate, on a commit or push onto the main branch (`main`, `master`, a remote's default branch, or the branch the main checkout holds when the command runs in a linked worktree). Off the main branch, a session's commit, local merge and plain push of the checked-out branch (`git push [-u] <remote> <branch>`, or `HEAD:<branch>`) pass, with a plain `git fetch` (no `a:b` refspec, no `--upload-pack=`) allowed in the same chain. A bare `git push`, a push of another branch, a forced push, a tag push, or any form the gate cannot read still asks, and so does everything in a repository with no remote or whose remote has no default branch recorded (`git remote set-head origin --auto`). A sub-agent's push always asks. With `--strict-consent` (the *Strict consent* switch on the console's Constitution page), every commit and push asks again, as before 2026-11. A sub-agent's commit or merge (`agent_id` in the payload) in a linked worktree, on a branch that is not shared, passes: a Foreman worker's own batch ([Foreman mode](foreman-mode.md) has the exact conditions). A git hook or `core.hooksPath` that pushes on commit is not seen. A push, or a command that mixes one in, still asks. Togglable: build without the process pack, or drop this rule alone with `--exclude-rules` (see [Exclusions](exclusions.md)). Only this question drops; the `deletion-is-deliberate` gate stays. | same as Claude Code | ask: permission prompt (`git commit*`/`git push*`), wired only when the process pack is on; a `loop/*` push is statically allowed. A glob sees only the command, never the worktree, so a worker's commit still asks | log only |
28
28
  | `external-gate` | rigor | ask: rule-gate (a write under a project's `.geneseed/protected-checks.txt` list, or to a gate's own configuration: hook settings, `excludes.json`, `AGENT.md` gate markers, the hook shim) | same as Claude Code | ask: OpenCode's own `permission.edit` rules, written by the emit (every `opencode.json(c)`, the hook settings, the install's `AGENT.md`, `excludes.json`, manifest, plugins, the hook shim); block: guard plugin (the protected-checks list, and the other hosts' Geneseed-only files) | block (exit 2), writes only; a hook `settings.json` only when the edit changes Geneseed's own hook entries |
29
29
  | `verify-before-asserting` | law | block at Stop, again only after a new edit or a changed background verdict, at most 3 times per continuation and 10 per turn: the done gate in `learn`, at SubagentStop too for a sub-agent's own turn (a turn that edited files, while a check in the project's `.geneseed/done-checks.txt` has not passed since the last edit; a check matches as a prefix of the command once both drop `npm --prefix`/`git -C` naming the judged project's own root and `--test-concurrency N`). Without that file, the checks are inferred from the git root's manifests and only warn (a `systemMessage` at Stop, never a block); switchable per install with `--no-done-gate` (see [Exclusions](exclusions.md)) | same as Claude Code (a frozen fork, and no check runs a model turn: [What is verified](host-matrix.md#what-is-verified)); that its SubagentStop sends `agent_transcript_path` is unverified, and without it a sub-agent's turn is not judged | remind: context plugin, on the next request (OpenCode 1 only; OpenCode 2 is not judged, and logs so) | not judged: Stop carries no transcript (log line) |
30
30
  | `commands-must-return` | ops | ask: git-gate (a recursive scan rooted at a filesystem root: `find /`, `du`, `grep -r`, `rg`, `Get-ChildItem -Recurse` at `/`, `/c`, `C:\`). Togglable: build without the ops pack, or drop this rule alone with `--exclude-rules`: the check goes on every host (`--no-root-scan`) | same as Claude Code | block: guard plugin (same root-scan pattern) | block (exit 2) |
@@ -38,7 +38,7 @@ Bob's `start_subtask` (the `subtask` group, held by the `agent` mode) does not c
38
38
 
39
39
  A task worker is one `developer` agent in its own git worktree. It explores, implements and tests in a single context, loading skills as it needs them, so nothing it read is lost in a hand-off. After two repair rounds on its own failing tests it returns with its findings instead of looping.
40
40
 
41
- A worker can lead a small team inside its own worktree. It can start read-only helpers (`explorer`, `researcher`) at any time. It can also start writing **sub-workers**, each in its own worktree branched from the worker's branch. The worker commits and merges their branches into its own branch, locally, and re-runs the proof after each merge. *Consent Before Push* names this as a batch. The git gate lets a commit or merge through without a prompt only when all of these hold: the host marks the call as a sub-agent's (Claude Code's `agent_id`), the directory is a linked worktree, and its branch is not shared (`main`, `master`, `develop`, `development`, `release/*`, `hotfix/*`, a remote's default, or the branch the main checkout has, in any letter case). The command may hold only adds, read-only git commands and plain commit or merge arguments with one quoted message, after at most one `cd`; anything that can run a second command (`(`, `@`, `$`, `{`, a backtick) asks. A session that only runs in a worktree, as the desktop app's do, still asks. A push still asks everywhere. Bob sends no sub-agent field, so Bob still logs its warning. On OpenCode the static `git commit*` permission still asks, because a permission glob sees only the command, not the worktree. The gate reads the command, not git's own hooks: a `post-commit` hook or a `core.hooksPath` can push on commit, on any branch, as it always could. Nesting stops at two levels below the session: session → worker → sub-worker. A sub-worker starts nothing. A lead holds every member's result before it ends. The blind reviewer is still the session's, never the worker's.
41
+ A worker can lead a small team inside its own worktree. It can start read-only helpers (`explorer`, `researcher`) at any time. It can also start writing **sub-workers**, each in its own worktree branched from the worker's branch. The worker commits and merges their branches into its own branch, locally, and re-runs the proof after each merge. *Consent Before Push* names this as a batch. The git gate lets a commit or merge through without a prompt only when all of these hold: the host marks the call as a sub-agent's (Claude Code's `agent_id`), the directory is a linked worktree, and its branch is not shared (`main`, `master`, `develop`, `development`, `release/*`, `hotfix/*`, a remote's default, or the branch the main checkout has, in any letter case). The command may hold only adds, read-only git commands, a plain `git fetch` (no `a:b` refspec, no option that names a program) and plain commit or merge arguments with one quoted message, after at most one `cd`; anything that can run a second command (`(`, `@`, `$`, `{`, a backtick) asks. A session that only runs in a worktree, as the desktop app's do, is judged by the own-branch pass instead ([Hooks](hooks.md)). A push still asks everywhere. Bob sends no sub-agent field, so Bob still logs its warning. On OpenCode the static `git commit*` permission still asks, because a permission glob sees only the command, not the worktree. The gate reads the command, not git's own hooks: a `post-commit` hook or a `core.hooksPath` can push on commit, on any branch, as it always could. Nesting stops at two levels below the session: session → worker → sub-worker. A sub-worker starts nothing. A lead holds every member's result before it ends. The blind reviewer is still the session's, never the worker's.
42
42
 
43
43
  | Host | What caps the depth |
44
44
  | --- | --- |
@@ -67,7 +67,7 @@ On Bob, a subagent's files cannot be told apart from its session's files (its ho
67
67
  - removing files (`rm`, `rmdir`, `del`, `erase`, `Remove-Item`) that git cannot restore: untracked, ignored or modified files, a repository's `.git`, or anything outside a repository.
68
68
 
69
69
  A force push to a feature branch, the protected-branch-only forms above on a feature branch, a new branch (`checkout -b`, `switch -c`), `reset --hard` over uncommitted work or to a commit that keeps every unpushed one, `branch -D` of a pushed branch, or `rm` of a tracked, unmodified file passes. When the gate cannot tell — a glob or `$variable` it would have to expand, a `cd` it cannot follow, `sh -c`/`xargs`, git failing or missing — it asks, and says it could not verify. To read the state it runs `git` itself, only once a command already looked destructive; every other command pays nothing. That is a Rule, so it holds in every build — unless you switch its gate off for one install with `--no-deletion-gate` (or the switch on Rule IV in the console's Constitution page). The hook is then wired with `--no-deletion-gate` and this check stands down; the Rule's text still binds the agent, and the catastrophic-command check above and the root-scan and consent checks below still run ([Exclusions](exclusions.md)).
70
- - **A `git commit` or `git push` onto the main branch** gets a prompt citing *Consent Before Push*: the main branch changes only through a pull request with green checks. The main branch is `main`, `master`, a remote's default branch, or, in a linked worktree, the branch the main checkout holds. On any other branch, a commit, a local merge and a plain push of the checked-out branch (`git push -u origin feature`, `git push origin HEAD:feature`) pass. A bare `git push` (where `push.default` and your git config decide the target), a push of a branch other than the checked-out one, a forced push, a tag push, a sub-agent's push, or a command the gate cannot read still asks. A quoted message is data: `git commit -m "fix(hooks): x"` passes, and so does a bash `git commit -F - <<'EOF'` heredoc whose delimiter is quoted; a `$(` or a backtick inside double quotes still asks. In a repository with no remote, or with a remote whose default branch is not recorded (`git remote add` records none; `git remote set-head origin --auto` does), the gate cannot tell your branch from the default one, so every commit and push asks. Build with `--strict-consent` (or turn on *Strict consent* on the console's Constitution page) and every commit and push asks again. This part belongs to the **process** doctrine pack: build without it, or exclude that rule, and the hook stays wired with `--no-consent` — commits and pushes go through without asking, real data loss is still stopped ([Rules](rules.md)).
70
+ - **A `git commit` or `git push` onto the main branch** gets a prompt citing *Consent Before Push*: the main branch changes only through a pull request with green checks. The main branch is `main`, `master`, a remote's default branch, or, in a linked worktree, the branch the main checkout holds. On any other branch, a commit, a local merge and a plain push of the checked-out branch (`git push -u origin feature`, `git push origin HEAD:feature`) pass, and so does a plain `git fetch` chained with them (`git fetch origin && git merge origin/main`); a fetch into a local branch (`origin main:main`) or one with an option that names a program (`--upload-pack=`) asks. A bare `git push` (where `push.default` and your git config decide the target), a push of a branch other than the checked-out one, a forced push, a tag push, a sub-agent's push, or a command the gate cannot read still asks. A quoted message is data: `git commit -m "fix(hooks): x"` passes, and so does a bash `git commit -F - <<'EOF'` heredoc whose delimiter is quoted; a `$(` or a backtick inside double quotes still asks, so Claude Code's habit of `-m "$(cat <<'EOF' … EOF)"` asks on every commit: the commit skill steers the agent to `-F -`. In a repository with no remote, or with a remote whose default branch is not recorded (`git remote add` records none; `git remote set-head origin --auto` does), the gate cannot tell your branch from the default one, so every commit and push asks. Build with `--strict-consent` (or turn on *Strict consent* on the console's Constitution page) and every commit and push asks again. This part belongs to the **process** doctrine pack: build without it, or exclude that rule, and the hook stays wired with `--no-consent` — commits and pushes go through without asking, real data loss is still stopped ([Rules](rules.md)).
71
71
  - **A recursive scan of a whole filesystem** — `find /`, `du -sh /`, `grep -r foo /`, `rg x C:\`, `Get-ChildItem C:\ -Recurse` — gets a prompt citing *Commands Must Return* (on Bob, it is blocked). In Git Bash `/` mounts every drive and mounted share, so such a scan runs for hours, and `| head` does not stop it. The prompt tells the agent to search a specific directory instead. A deeper path (`find /c/Users/me/project`), `ls /` without `-R` (`ls -r` is reverse order, not recursion), a quoted argument (a search pattern such as `grep -rn "/" src`), a `#` comment, and the remote half of an `ssh` command pass. It belongs to the **ops** pack: build without it, or exclude that rule, and the hook is wired with `--no-root-scan` and this check stands down (also on Bob and in the OpenCode guard); every other check stays ([Exclusions](exclusions.md)).
72
72
  - **A shell write to a protected check or a gate's own configuration** gets the same *External Gate* prompt as a write tool (see rule-gate below; on Bob, it is blocked). `--no-consent` does not touch it.
73
73
  - Any other command passes untouched.
@@ -2,5 +2,5 @@
2
2
  "_comment": "version is a human-readable release label only; the canonical identity of an installed harness is the source fingerprint stamped in .geneseed-version (see `harness version`), not this string.",
3
3
  "theme": "neutral",
4
4
  "product": "Geneseed",
5
- "version": "5.5.1"
5
+ "version": "5.6.0"
6
6
  }
@@ -136,6 +136,14 @@ const ARG_RE = '[\\w./:@^~=+,-]+';
136
136
  const SEG_ADD_RE = new RegExp(`^git\\s+add(\\s+${ARG_RE})*$`);
137
137
  const SEG_COMMIT_RE = new RegExp(`^git\\s+commit(\\s+-q)?\\s+(-F\\s+|--file[=\\s])${ARG_RE}(\\s+-q)?$`);
138
138
  const SEG_READONLY_RE = new RegExp(`^git\\s+(status|diff|log|rev-parse|show)(\\s+${ARG_RE})*$`);
139
+ // A fetch writes only remote-tracking refs, FETCH_HEAD and tags git will not clobber, never a
140
+ // local branch, as long as no refspec names a destination (`a:b`, `+a:b`) and no option names a
141
+ // program (`--upload-pack=<cmd>` runs one). So: a few flags that take no value, then at most one
142
+ // remote and its branches, each a plain name whose first character is alphanumeric (no `:`, no
143
+ // `+`, no flag, no `.` or path for the remote). Added for the own-branch and worker passes
144
+ // (2026-11-17): `git fetch origin && git merge origin/main && git commit …` is how a branch
145
+ // catches up with its base, and the fetch alone made the whole chain ask.
146
+ const SEG_FETCH_RE = /^git\s+fetch(?:\s+(?:--prune|-p|--tags|-t|--no-tags|--all|--quiet|-q))*(?:\s+[A-Za-z0-9][A-Za-z0-9._-]*(?:\s+[A-Za-z0-9][\w./-]*)*)?$/;
139
147
 
140
148
  /**
141
149
  * `git push`, exactly: `[-u|--set-upstream] <remote> HEAD:<branch>` or
@@ -209,8 +217,9 @@ const SHARED_BRANCH_RE = /^(?:main|master|develop|development|(?:release|hotfix)
209
217
  * sets on tool events inside a subagent or in-process teammate). A session that merely runs in
210
218
  * a worktree, as the desktop app's do, has none and asks. A host that sends none asks always.
211
219
  * - The command: none of `UNSAFE_CHARS_RE` or `SUBSHELL_CHARS_RE`, no `push` word anywhere (a mixed
212
- * command asks), every segment an add, a read-only look, or `SEG_LOCAL_RE`, after at most one
213
- * leading `cd <path>` (an agent's shell starts in the parent's checkout). The `cd` target and
220
+ * command asks), every segment an add, a read-only look, a fetch (`SEG_FETCH_RE`) or
221
+ * `SEG_LOCAL_RE`, after at most one leading `cd <path>` (an agent's shell starts in the
222
+ * parent's checkout). The `cd` target and
214
223
  * `cwd` are resolved with `realpathSync`, git's physical path; `cd -`, `~` or a path that does
215
224
  * not resolve asks.
216
225
  * - The tree: `cwd` a linked worktree (`mainWorktreeOf`, read off disk, no spawn), its branch
@@ -232,7 +241,7 @@ export function worktreeExempt(command, cwd, agentId) {
232
241
  segments.shift();
233
242
  }
234
243
  if (!segments.length || !segments.every((seg) => SEG_ADD_RE.test(seg) || SEG_READONLY_RE.test(seg)
235
- || SEG_LOCAL_RE.test(seg))) return false;
244
+ || SEG_FETCH_RE.test(seg) || SEG_LOCAL_RE.test(seg))) return false;
236
245
  const main = mainWorktreeOf(dir);
237
246
  const branch = main && currentBranch(dir);
238
247
  if (!branch || branch.includes('..') || SHARED_BRANCH_RE.test(branch)) return false;
@@ -339,7 +348,8 @@ function maskMessages(command, shell) {
339
348
  * - No `agentId`: a sub-agent never pushes, and its local commits are `worktreeExempt`'s to judge.
340
349
  * - The command, with its messages masked (`maskMessages`): none of `UNSAFE_CHARS_RE` or
341
350
  * `SUBSHELL_CHARS_RE`; every segment an add, a
342
- * read-only look, a plain commit or merge (`SEG_LOCAL_RE`, or the loop's `-F` commit), or a
351
+ * read-only look, a fetch (`SEG_FETCH_RE`), a plain commit or merge (`SEG_LOCAL_RE`, or the
352
+ * loop's `-F` commit), or a
343
353
  * plain push (`SEG_PUSH_RE`) of THIS branch, spelled `<branch>`, `HEAD:<branch>` or
344
354
  * `HEAD:refs/heads/<branch>`; after at most one leading `cd <path>`. Bare `git push` asks:
345
355
  * `push.default` and the global config decide where it goes, and this read cannot see them.
@@ -384,7 +394,8 @@ export function ownBranchExempt(command, cwd, agentId, shell = null) {
384
394
  const taken = [...protectedBranches(root), main && currentBranch(main)].filter(Boolean);
385
395
  if (taken.some((b) => b.toLowerCase() === branch.toLowerCase())) return false;
386
396
  return segments.every((seg) => {
387
- if (SEG_ADD_RE.test(seg) || SEG_READONLY_RE.test(seg) || SEG_LOCAL_RE.test(seg) || SEG_COMMIT_RE.test(seg)) return true;
397
+ if (SEG_ADD_RE.test(seg) || SEG_READONLY_RE.test(seg) || SEG_FETCH_RE.test(seg) || SEG_LOCAL_RE.test(seg)
398
+ || SEG_COMMIT_RE.test(seg)) return true;
388
399
  const push = SEG_PUSH_RE.exec(seg);
389
400
  if (!push) return false;
390
401
  const ref = push[2];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "Every field here is argued and gated in tests/unit/package_manifest.test.mjs. `files`, `bin`, `exports` and `engines` each have a test that fails when reality drifts from this file; `version` mirrors harness.config.json and is gated too. Read that docblock before editing this one.",
3
3
  "name": "geneseed",
4
- "version": "5.5.1",
4
+ "version": "5.6.0",
5
5
  "description": "A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent.",
6
6
  "keywords": [
7
7
  "ai",
@@ -19,6 +19,10 @@
19
19
  repo has no discernible convention, default to **Conventional Commits**:
20
20
  `type(scope): subject` (`feat`, `fix`, `docs`, `refactor`, `test`, `chore`…),
21
21
  with a `!` before the colon or a `BREAKING CHANGE:` footer for a breaking change.
22
+ **Pass the message as data the commit gate can read:** one quoted `-m '…'` for a
23
+ subject alone; for a body, under bash, `git commit -F - <<'EOF'` … `EOF` with the
24
+ delimiter quoted. Never `-m "$(cat <<'EOF' … EOF)"`: the gate cannot see inside a `$(`,
25
+ so it asks even on your own branch.
22
26
  5. **Commit on your own branch; never on the main branch ({{DOCTRINE:consent-before-push}}).**
23
27
  On your own branch, commit without asking once steps 1–4 hold. The main branch
24
28
  (`main`, `master`, the remote's default, and from a linked worktree the main checkout's branch) takes no direct