diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 63691a4..f8c3e9a 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -6,14 +6,14 @@ }, "metadata": { "description": "Basalt — the trust layer for AI-generated work. Connect your AI to publish, update and share governed docs by URL.", - "version": "0.3.3" + "version": "0.3.4" }, "plugins": [ { "name": "basalt", "source": "./plugins/basalt", "description": "Connect your AI to Basalt — publish, update and share governed docs by URL. Bundles the Basalt MCP server (OAuth) + a skill that converges on it when you ask to publish or share written work.", - "version": "0.3.3", + "version": "0.3.4", "author": { "name": "Cofoundy SAC" }, diff --git a/README.md b/README.md index 473917e..b415b0c 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,8 @@ that talks when it doesn't need to is just noise: network, no output). - **At the end of a turn** — if you edited vault docs but didn't publish, one line asks whether to publish. Set `publish: auto` in that `vault.yaml` and it publishes - the changed files for you (diff-aware, once per turn — never on every keystroke). + the changed files for you (diff-aware, once per turn — never on every keystroke), + even when the repo's own publish Action would get to them a minute later. Per-vault policy lives in `vault.yaml`: `publish: prompt` (default) · `auto` · `manual`. When one doc needs a different answer than its vault — the server refuses diff --git a/plugins/basalt/.claude-plugin/plugin.json b/plugins/basalt/.claude-plugin/plugin.json index bcf09a9..3f105a4 100644 --- a/plugins/basalt/.claude-plugin/plugin.json +++ b/plugins/basalt/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "basalt", "description": "Connect your AI to Basalt — publish, update and share governed docs by URL. Bundles the Basalt MCP server (OAuth), a skill that converges on it when you ask to publish or share written work, and quiet session hooks (auth probe · edit tracking · publish nudge).", - "version": "0.3.3", + "version": "0.3.4", "author": { "name": "Cofoundy SAC", "url": "https://cofoundy.dev" diff --git a/plugins/basalt/hooks/stop.sh b/plugins/basalt/hooks/stop.sh index 732e6bb..ebac104 100755 --- a/plugins/basalt/hooks/stop.sh +++ b/plugins/basalt/hooks/stop.sh @@ -52,9 +52,12 @@ auto_files=(); prompt_n=0 if [ -f "$df" ]; then while IFS= read -r f; do [ -n "$f" ] || continue + policy="$(doc_policy "$(find_vault "$f")" "$f")" + # `auto` asked for THIS turn: the Action would publish a minute later, and a second + # publish of the same source is a server sha-skip. So `auto` never defers to it. + [ "$policy" = "auto" ] && { auto_files+=("$f"); continue; } published_by_repo_action "$f" && continue # Mechanism B → already publishing - case "$(doc_policy "$(find_vault "$f")" "$f")" in - auto) auto_files+=("$f") ;; + case "$policy" in manual) : ;; # explicitly silent *) prompt_n=$((prompt_n + 1)) ;; # prompt (default) esac diff --git a/plugins/basalt/hooks/tests/run.sh b/plugins/basalt/hooks/tests/run.sh index 2738e7b..04f8824 100755 --- a/plugins/basalt/hooks/tests/run.sh +++ b/plugins/basalt/hooks/tests/run.sh @@ -568,6 +568,20 @@ D3="$(add_doc "$R_BLOCK" docs/note.mdx push)" seed_stop "$D3" expect_silent "(a) block-sequence list form (paths:\\n - '**.md'\\n - '**.mdx') is read too" +# (a′) `publish: auto` wins over Mechanism B. The Action publishes a pushed doc a minute +# later; a vault that asked for `auto` asked for THIS turn. Publishing what the Action will +# also publish costs nothing (the server sha-skips the second one), so `auto` publishes it +# now instead of leaving it to the runner queue. +R_AUTOWF="$(mk_repo autowfvault "$WF_CANON")" +printf 'name: autowfvault\npublish: auto\n' > "$R_AUTOWF/vault.yaml" +git -C "$R_AUTOWF" commit -qam auto >/dev/null 2>&1 && git -C "$R_AUTOWF" push -q origin main >/dev/null 2>&1 +D_AUTOWF="$(add_doc "$R_AUTOWF" docs/note.md push)" +seed_stop "$D_AUTOWF"; : > "$BASALT_STUB_CALLS" +out="$(BASALT_STUB_MODE=publish-ok stop_out)" +{ printf '%s' "$out" | grep -qi 'auto-published' && grep -Fxq "$D_AUTOWF" "$BASALT_STUB_CALLS"; } \ + && ok "(a′) publish: auto + doc the Action covers → published THIS turn, not left to the runner" \ + || no "(a′) auto must not defer to the Action (out:${out:-} calls:$(cat "$BASALT_STUB_CALLS"))" + # (b) THE NEGATIVE ARM — the one that gets skipped. A fix that silences the hook in all # three arms has deleted the feature instead of repairing it. D_DIRTY="$(add_doc "$R_CANON" docs/uncommitted.md dirty)"