mason-context 0.7.0 → 0.8.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
@@ -223,7 +223,19 @@ jobs:
223
223
  secrets: inherit
224
224
  ```
225
225
 
226
- Omit `agent-command` for detect-only mode: no agent, no credentials — the job fails when the context files have drifted, which is a reasonable default for repos that want the signal before the automation. Note: PRs created with the default `GITHUB_TOKEN` don't trigger the repo's own CI; run your agent with PAT-backed auth if you need that.
226
+ Omit `agent-command` for detect-only mode: no agent, no credentials — the job fails when the context files have drifted, which is a reasonable default for repos that want the signal before the automation. Two GitHub notes: the repo setting **"Allow GitHub Actions to create and approve pull requests"** (Settings → Actions → General) must be enabled for the PR step, and PRs created with the default `GITHUB_TOKEN` don't trigger the repo's own CI run your agent with PAT-backed auth if you need that.
227
+
228
+ ## Decision injection (mason-hook)
229
+
230
+ Recorded knowledge only helps if it shows up. Retrieval tools depend on the model deciding to call them — and it often doesn't. `mason-hook` removes the gamble: it's a Claude Code `PostToolUse` hook that fires when a session reads or edits a file, looks up the decision records anchored to that file (exact path or directory prefix), and injects them into the model's context. Deterministic lookup, no LLM call, ~100ms, silent when nothing matches. Each decision is injected at most once per session, and records whose anchors drifted since verification carry a verify-before-relying marker.
231
+
232
+ ```bash
233
+ npx -p mason-context mason-hook --print-config # the settings block to add
234
+ ```
235
+
236
+ Add the printed block to `.claude/settings.json` — the *committed* project settings, so every teammate's sessions get the same rail. The loop this closes: someone records a constraint once with `save_decision` ("this screen has a v1 and v2 — new work goes in v2 behind flag X"), and from then on any session that touches those files gets told, whether or not it thought to ask.
237
+
238
+ For faster fires than `npx` resolution allows, install the package (`npm i -D mason-context`) and point the command at `node_modules/.bin/mason-hook`.
227
239
 
228
240
  ## Confluence sync
229
241
 
@@ -231,6 +231,7 @@ function normalizePathToken(token) {
231
231
  if (t.includes(":")) return null;
232
232
  const normalized = t.replace(/\/+$/, "");
233
233
  if (!normalized) return null;
234
+ if (normalized.split("/").some((seg) => /^\.+$/.test(seg))) return null;
234
235
  if (normalized.includes("/")) return normalized;
235
236
  return ROOT_FILE_NAMES.has(normalized) ? normalized : null;
236
237
  }