geneseed 4.27.0 → 4.27.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/CHANGELOG.md CHANGED
@@ -8,6 +8,16 @@ label. For the capability ↔ spec map, see [SHIPPED.md](SHIPPED.md).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [4.27.1] — 2026-10-27
12
+
13
+ Patch: the guard's refusals no longer name the switch that turns it off.
14
+
15
+ ### Upgrade notes
16
+ - Run `geneseed rebuild-all` once after updating so OpenCode installs get the new guard plugin. Claude Code, OpenClaude and Bob get the new hook text with the update itself.
17
+
18
+ ### Fixed
19
+ - **A refusal no longer reads as leave to get round it.** Every OpenCode guard refusal ended with `— set GENESEED_GUARD=off to allow`. A weak model on OpenCode took that as permission and wrote the blocked memory index through a `python3` shell command instead of re-issuing the edit. The refusals no longer name any switch; `GENESEED_GUARD` stays documented for you in [the guard page](docs/reference/plugin-guard.md). The *Persist Insight* text (the first write to `user-rules.md` or a memory file) now ends, on every host, with: "Stop and ask the user now (the rule skill). If this edit was refused, re-issue the same edit only after they answer; never write it another way (for example through a shell command)." On Bob, where this gate only warns and the write already went through, the condition keeps the model from applying the edit twice. The same calls are blocked as before.
20
+
11
21
  ## [4.27.0] — 2026-10-27
12
22
 
13
23
  Minor: ownership — the developer decides each part of production code, at a granularity the team sets in the root `AGENTS.md`; a Credo section, the ownership skill, and a first-write gate that is on by default (see the ⚠️ entry). Re-emit every install with `geneseed rebuild-all` to get the new Credo section, the skill, the `develop`/`developer`/Foreman changes and the OpenCode guard.
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: **4.27.0**.
23
+ > string. Current label: **4.27.1**.
24
24
 
25
25
  ## Capabilities
26
26
 
@@ -1310,6 +1310,10 @@ async function protectedPrefixes() {
1310
1310
  // project's unrelated memory/ folder is never caught.
1311
1311
  const RULE_STORE_BUMPED = new Set()
1312
1312
  const nocase = (s) => (process.platform === "win32" ? s.toLowerCase() : s)
1313
+ // Word for word js/hosts/hooks.mjs's PERSIST_ASK. A weak model once took a refusal as leave to
1314
+ // write the same file through a shell command, so the text names the one way forward.
1315
+ const PERSIST_ASK = "Stop and ask the user now (the rule skill). If this edit was refused, re-issue " +
1316
+ "the same edit only after they answer; never write it another way (for example through a shell command)."
1313
1317
  function ruleStoreTarget(p) {
1314
1318
  const abs = (path.isAbsolute(p) ? p : path.resolve(p)).replace(/\\/g, "/")
1315
1319
  const base = path.basename(abs).toLowerCase()
@@ -1461,13 +1465,13 @@ export const GeneseedGuard = async (ctx) => {
1461
1465
  const args = output?.args || input?.args || {}
1462
1466
  // `rule` is the ledger key, spelled as js/hosts/hooks.mjs spells it (`law-1`,
1463
1467
  // `law-4`, `process-1`) plus `wiki`, so status counts one vocabulary across hosts.
1464
- // `tail: false` for the ownership gate: its reason names its own ways out, and the next
1465
- // write passes anyway, so pointing at GENESEED_GUARD=off would only invite disabling it.
1466
- const deny = async (why, rule, tail = true) => {
1468
+ // The model reads this text. It never names the GENESEED_GUARD switch: a weak model read
1469
+ // "set GENESEED_GUARD=off to allow" as leave to route the write through a shell (4.27.1).
1470
+ const deny = async (why, rule) => {
1467
1471
  if (WARN_ONLY) { log(`WARN (would block): ${why}`); return false }
1468
1472
  log(`BLOCKED: ${why}`)
1469
1473
  await ledger(rule)
1470
- throw new Error(`[geneseed-guard] blocked: ${why}${tail ? " — set GENESEED_GUARD=off to allow" : ""}`)
1474
+ throw new Error(`[geneseed-guard] blocked: ${why}`)
1471
1475
  }
1472
1476
  try {
1473
1477
  // `apply_patch`'s own tool resolves every marker path against `instance.directory`
@@ -1490,9 +1494,9 @@ export const GeneseedGuard = async (ctx) => {
1490
1494
  const store = ruleStoreTarget(p)
1491
1495
  if (store && !RULE_STORE_BUMPED.has(p)) {
1492
1496
  RULE_STORE_BUMPED.add(p)
1497
+ // Twin of js/hosts/hooks.mjs's process-1 text — keep the closing sentences in step.
1493
1498
  await deny(`writing to ${store} — a standing rule, or a fact to remember? That ` +
1494
- `choice is the user's (Persist Insight). Settle it through the rule skill, ` +
1495
- `then re-issue this write`, "process-1")
1499
+ `choice is the user's (Persist Insight). ${PERSIST_ASK}`, "process-1")
1496
1500
  return
1497
1501
  }
1498
1502
  }
@@ -1513,7 +1517,7 @@ export const GeneseedGuard = async (ctx) => {
1513
1517
  if (!OWNERSHIP_GATE_OFF) {
1514
1518
  for (const p of paths) {
1515
1519
  const why = ownershipBlock(path.resolve(cwd, p), input?.sessionID)
1516
- if (why && !(await isChildSession(input.sessionID))) { await deny(why, "ownership", false); return }
1520
+ if (why && !(await isChildSession(input.sessionID))) { await deny(why, "ownership"); return }
1517
1521
  }
1518
1522
  }
1519
1523
  }
@@ -21,7 +21,7 @@ There is no DYNAMIC loop/* exemption on OpenCode — it declares a `permission.a
21
21
 
22
22
  **When it runs.** Before every tool call (`tool.execute.before`).
23
23
 
24
- **What you see.** A refused tool call: `[geneseed-guard] blocked: <reason> — set GENESEED_GUARD=off to allow`. Warnings go to stderr.
24
+ **What you see.** A refused tool call: `[geneseed-guard] blocked: <reason>`. The reason never names the switches below: the agent reads it, and a switch named there reads as leave to get round the block. The *Persist Insight* reason tells the agent to ask you and, once you answer, re-issue the same refused edit — never to write the file another way (through a shell command, say). Warnings go to stderr.
25
25
 
26
26
  **Switches.**
27
27
  - `GENESEED_GUARD=warn` — log every block, allow the call.
@@ -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": "4.27.0"
5
+ "version": "4.27.1"
6
6
  }
@@ -544,6 +544,13 @@ export const cmdGitGate = guardGate(gitGate, 'git-gate');
544
544
  * Geneseed's own coinage and match anywhere; any other markdown matches only inside THIS
545
545
  * install's `<root>/memory/`.
546
546
  */
547
+ // The close of the process-1 text, word for word the OpenCode guard's PERSIST_ASK (tests pin
548
+ // both). A weak model once took a refusal as leave to write the same file through a shell
549
+ // command, so the text names the one way forward and never a switch that turns the gate off.
550
+ export const PERSIST_ASK = 'Stop and ask the user now (the rule skill). If this edit was refused, '
551
+ + 're-issue the same edit only after they answer; never write it another way (for example '
552
+ + 'through a shell command).';
553
+
547
554
  function ruleGateTarget(p, root) {
548
555
  if (typeof p !== 'string') return null;
549
556
  // Split on BOTH separators rather than taking a basename: a payload carrying a Windows
@@ -657,8 +664,7 @@ function ruleDecide(args, payload) {
657
664
  return why ? deny(args, 'rule-gate', 'ownership', why) : 0;
658
665
  }
659
666
  return ask(args, 'rule-gate', 'process-1', `Geneseed (Persist Insight) \u2014 writing to `
660
- + `${target}: a standing rule, or a fact to remember? That choice is the user's. Run the `
661
- + 'rule skill first.');
667
+ + `${target}: a standing rule, or a fact to remember? That choice is the user's. ${PERSIST_ASK}`);
662
668
  }
663
669
  export const cmdRuleGate = guardGate(ruleGate, 'rule-gate');
664
670
 
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` 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": "4.27.0",
4
+ "version": "4.27.1",
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",