hive-agent: keep an own /knowledge clone current from the swarm knowledge event
This commit is contained in:
parent
ff4e42f1ae
commit
989d1d578c
1 changed files with 347 additions and 1 deletions
|
|
@ -66,6 +66,24 @@ read token when it has one (see
|
|||
[forge-accounts.md](forge-accounts.md#how-a-hive-reads-the-forge)) and clones the public
|
||||
repo anonymously otherwise.
|
||||
|
||||
### The agent's own clone
|
||||
|
||||
Each agent harness also keeps its own shallow clone of `internal/knowledge`
|
||||
(`hive-agent/src/knowledge_sync.rs`), under the harness dir as `knowledge/`,
|
||||
without going through the hive. The agent's queue token may subscribe to
|
||||
`$SWARM.knowledge` (and not publish it), so the harness hears the same event
|
||||
as the hive: on it, once at start and hourly as a fallback, it fetches and
|
||||
resets the clone to the remote head (`GIT_TERMINAL_PROMPT=0`, a five-minute
|
||||
limit per git command, anonymous because the repo is public). When the head
|
||||
moved it raises one keyed `knowledge` todo carrying the `git diff --stat`, so
|
||||
a second change before the agent reads the first updates the same row; the
|
||||
first clone raises nothing. A failed or timed-out sync logs a warning, and the
|
||||
next trigger retries it.
|
||||
|
||||
This runs next to the host mount for now: `/knowledge` is still the host's
|
||||
bind mount and the `/knowledge updated` broadcast above still goes out, until
|
||||
a later change removes the host side.
|
||||
|
||||
## State
|
||||
|
||||
<!-- vale write-good.Passive = NO -->
|
||||
|
|
|
|||
Loading…
Reference in a new issue