Repository navigation
Commit 13ef822
Add the knowledge publisher (kb publish) for the GPU box
The only GitHub writer for knowledge PRs. It runs as the repository owner
through the box's existing gh login, which never reaches the bot host or any
model environment.
- publisher: each round reads the service's signed control record over SSH
(or a local directory) and does nothing when it is stale. Every outbox item
goes through check_item (signature, expiry, generation, pause, and
auto_merge in both the control record and the publisher's OWN adapter
configuration). The publisher performs the item, records the result
locally, then writes a kb-ack signed with the publisher key. Items it cannot
verify or must not execute are neither performed nor answered. Every
decision is traced to traces/publisher.jsonl.
- idempotent: an item already performed only has its ack re-sent; completion
records are written atomically, and a corrupt one is set aside for people,
never guessed. open_pr reuses an open PR on its branch only when its head
is exactly the rebuilt commit (and a draft for companions). It rebuilds the commit deterministically from
the signed contents on base_sha in a scratch index, and refuses to
overwrite an existing branch with other content. It also refuses any path
that is not a governed knowledge page.
- actions: open_pr and open_companion_pr (always a draft). post_verdict,
enqueue and update_branch first check that the PR is open at the signed
head; enqueue marks a paused draft ready, then runs gh pr merge --auto
--match-head-commit. pause runs procedure P: dequeue, disable auto-merge,
convert to draft (verified), then label kb:hold. close closes the PR.
A post_verdict (issued only for an unpaused repository under its current
generation) first removes kb:hold and confirms it is gone before
commenting, so pause, then resume, then re-gate, then enqueue completes.
- a failed pause or close is never acknowledged: it stays in the outbox
and is retried every round until it succeeds. Malformed control records
and items are traced and skipped; they never stop the daemon.
- transport failures (ssh down while listing or delivering an ack) are
traced, never fatal: the completion record stays and the ack is re-sent
next round without repeating the action.
- double gate: without ALLOW_POST=1 a round only records what it would do;
pushing a branch also needs ALLOW_PUSH=1.
- CLI: kb publish (--remote host:/state | --local dir) [--once]. It needs
KB_SERVICE_PUBKEY, KB_PUBLISHER_KEY and KB_PUBLISHER_GIT_AUTHOR, and never
opens the service ledger.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 1671a31 commit 13ef822
5 files changed
Lines changed: 912 additions & 0 deletions
File tree
- doc
- architecture/SPEC
- features
- src/infermatrix_copilot/kb_service
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
108 | 121 | | |
109 | 122 | | |
110 | 123 | | |
| |||
114 | 127 | | |
115 | 128 | | |
116 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
117 | 133 | | |
118 | 134 | | |
119 | 135 | | |
| |||
220 | 236 | | |
221 | 237 | | |
222 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
0 commit comments