Decisions pinned to code
A decision, an ADR or a runbook describes code. When that code changes, the page may be wrong. Pin the page to the code, and Nexara marks it Needs check the moment a push touches that code:
The page stays as it is. Somebody reads it, then marks it Still current or edits it. Until then, agents see the note and rank the page below current pages.
What a pin is
A pin is a repository, a file or folder in it, optional lines, and the commit the page was written against. It lives in the page's frontmatter, so git holds it like any other property:
---
title: Login uses server sessions
type: decision
pins:
- repo: https://github.com/acme/api
path: src/auth/login.ts
lines: 10-40
commit: 4f2a91c
- repo: https://github.com/acme/api
path: src/session/
---
| Field | Meaning |
|---|---|
repo | The repository URL. https://, ssh:// and git@host:owner/repo forms of the same repo are one repo. |
path | A file, or a folder ending with / (everything below it counts). No ... |
lines | Optional, files only: 40 or 10-40. |
commit | Optional: the commit the page describes. A change in this exact commit does not flag the page. |
A page can carry up to 20 pins. A pin that does not parse is reported on the page and ignored; it never breaks the page.
Pinning a page
- In the app: open the page, then Pin to code (or Edit pins) under the properties.
- From an agent: the MCP tool
context_pinadds or updates one pin (same repo and path updates it;remove: truedrops it). It goes through the agent's trust like any other change: on Suggest a person accepts it first. - Over the API:
PUT /api/v1/nodes/:id/pinswith{"pins": [...]}replaces the list; an empty list removes it. - In git or Obsidian: write the
pins:key yourself.
Pinning is a change to the page: it needs the right to change the page, it is one commit, and it is in the audit log (node.pin).
When code changes
With a webhook (GitHub or GitLab)
An owner or admin adds the repository once in Settings, Code webhooks: repository URL, provider and (optionally) the branch to watch (the repo's default branch otherwise). Nexara answers with a payload URL and a secret. The secret is shown once. Then, in the repository:
- GitHub: Settings, Webhooks, Add webhook. Payload URL as given, content type
application/json, the secret, "Just the push event". - GitLab: Settings, Webhooks. URL as given, the secret as Secret token, trigger Push events.
Each push to the watched branch is matched against every pin on that repo. A pinned file that was changed, removed or renamed, or anything below a pinned folder, marks the page Needs check with the commit and the number of files. The same push delivered twice changes nothing.
What the webhook does not do:
- It never fetches anything. It reads only the file names the push payload already lists, so a private repository's code never leaves it, and there is no address for the request to be pointed at.
- It never says what it did. Once the signature checks, the answer is
{"ok": true}: not which pages are pinned, not how many were flagged. A wrong signature and an unknown webhook get the same401. - A push payload has no line numbers, so a pin with
linesis flagged when its file changes at all. Use Check now with a diff for line-level checks. - GitHub lists up to 2,048 commits per push and GitLab 20. A bigger push is recorded as
truncatedon the repo row: run Check now for that range.
Rotate a secret from the same screen (the old one stops working at once). Removing a repo stops reading its pushes; pins and flags stay.
Without a webhook: Check now
For a repository that does not send pushes here, open the pinned page, choose Check now, give the commit range (1a2b3c4..5d6e7f8) and paste what changed. In the repository, run:
git diff --name-status 1a2b3c4..5d6e7f8
--numstat, --stat, git log --name-status and a plain list of paths work too. Paste a full git diff to check lines pins against the lines that actually changed. Renames (R087 old new, {a => b}) count for both the old and the new path.
Check now flags only pages you could change (edit or propose on), and only answers with those. The API is POST /api/v1/code-pins/check with {repo, range, changes, node_id?}.
Where Needs check shows
- On the page: the Needs check note says which pinned path changed, in which commit, and how many files (with line counts when you pasted them).
- Home: the Pinned code changed card lists the pages you can open whose pinned code changed.
- Explore and the sidebar: List and Tree views and the sidebar mark the page Needs check.
- Timeline and Activity: each flag is an activity event, "Pinned code changed (Needs check)".
- Agents:
context_getandcontext_searchcarry the Needs check state and sentence, like any other stale page.
To clear it, mark the page Still current (page menu, State), or re-pin it at the new commit. A later push flags it again.
Privacy
- A pin is part of its page: anyone who cannot open the page sees nothing about it. No list, count or webhook answer names a page the viewer cannot open.
- On a Secret page, the pins are sealed in git like its title, so a clone shows nothing about which code it covers. Lists show a Secret page's flag as "pinned code changed in <commit>" until you step up; the page itself, after step-up, shows the path.
- Webhook secrets are stored sealed with a key derived from
MASTER_KEY, never listed, and shown only right after they are made (which needs a fresh step-up). - Every pin change, flag, check and repo change is in the audit log:
node.pin,node.code_changed,code.check,code_repo.create,code_repo.rotate,code_repo.delete.