Skip to content

feat(cognee): add local lookup manifest checker - #128

Closed
JTInventory wants to merge 1 commit into
kunchenguid:mainfrom
JTInventory:feat/cognee-local-lookup
Closed

JTInventory wants to merge 1 commit into
kunchenguid:mainfrom
JTInventory:feat/cognee-local-lookup

Conversation

@JTInventory

Copy link
Copy Markdown

Summary

Firstmate can now rehearse Cognee lookup locally without touching Cognee, MCP config, env files, or remote datasets. A dry-run wrapper treats answer text as hint_only by default, then upgrades only locally verified references to verified_local_source or stale_warning after manifest, checksum, path-risk, and source reopen checks pass.

The checker fails closed for missing citations, unknown manifest references, unsafe redaction status, risky source paths, bad size/checksum, and high/live stale-risk labels. Even verified local matches keep external_action_authorized=false, so memory output cannot become merge, deploy, cleanup, vendor, or customer authority.

Notes

  • Manifest support is TSV-only in this first wrapper; JSONL can be added later if a real importer needs it.
  • No Cognee API path is implemented. Running without --dry-run exits before any network or config access.
  • Code review was a manual staged-diff review. The multi-agent CE review path was not used because this harness exposes sub-agents only when the user explicitly requests delegation.

Tests

  • bash -n bin/*.sh tests/*.sh
  • tests/fm-cognee-lookup.test.sh
  • for t in tests/*.test.sh; do bash "$t"; done

Post-Deploy Monitoring & Validation

No additional production monitoring is required. This is local CLI plumbing only, with no daemon, network call, config mutation, or remote dataset mutation. Healthy validation is continued passing shell tests and local dry-run output that keeps unverified Cognee text labeled as hint_only.


Compound Engineering
GPT-5

@JTInventory

Copy link
Copy Markdown
Author

Closing because this work is maintained in the JTInventory fork. We are not expecting upstream review or merge for this branch.

@JTInventory JTInventory closed this Jul 1, 2026
fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
…on (kunchenguid#128)

* feat(bin): gate the spoken companion relay on recorded freshness

The voice trial failed the same way each time: an instruction was acted on,
or spoken, after it stopped being true. A password step was read out after
the sign-in already succeeded, a prior answer came back as if it were new,
and a queue receipt was reported as though the work had happened.

fm-voice-relay.sh keeps that decision on disk instead of in a conversation
that compacts. One record per topic, corrections advance its revision rather
than opening a second request, and two gates read it - one before an action
is performed, one before a sentence is spoken. A success retires the pending
substeps of its own topic and nothing else, an exact sentence is never spoken
twice, an enqueue receipt never counts as delivery, and "did you send it?" is
answered from the record rather than by sending again. Every state change is a
publish-once hard link, so racing callers leave exactly one winner and a
receipt, once published, is never rewritten.

fm-voice-relay-appserver.sh carries the correction to a turn that is already
running. codex queue exposes no interrupt, cancel, or priority option, but the
app-server protocol the same build speaks defines turn/steer, turn/interrupt,
thread/turns/list and thread/read, and turn/steer takes an expectedTurnId -
so a correction is a compare-and-swap against the turn the caller believes is
running. Every command is a dry run until --live, and thread-status reports
whether the answering server actually owns the thread, because a server that
can read history but reports the thread not loaded cannot steer it.

What the pair deliberately does not claim: it cannot recall an action that
already happened, it records that text was released to a speaking frontend
rather than that anything was heard, and its pending count is a count of
tracked requests, not of a native queue it cannot see.

* chore(fork-surface): declare the voice relay capability

The relay scripts and their suites are fork-only paths, so the manifest has to
claim them or the surface gate reports them unowned. The commits entry points
at the implementation commit and follows the file's existing convention of
being repaired to the squash-merge commit once the PR lands.

* no-mistakes(review): harden voice relay gates, quoting, and rpc bound

* no-mistakes(review): separate write-failed exit code, stream rpc answers

* no-mistakes(review): always reap rpc proxy child, bound command parsing

* no-mistakes(document): document voice relay scripts in toolbelt and backend contract

* no-mistakes(document): print full exit-code list in appserver --help

* fix(bin): stop the relay reporting claims as verified evidence

Independent review reproduced both of these against the shipped build, and
both are the ledger committing the exact confusion it exists to prevent.

thread/read returns ThreadStatus as a tagged union - {"type":"notLoaded"},
idle, systemError, or active with activeFlags - and the adapter compared it
as a bare string. A not-loaded thread therefore printed "reports the thread
loaded", inverting the single check the whole steering claim rests on. The
status is now read from its type field: only active is steerable, idle means
the thread is held with no turn running, notLoaded and systemError are not
steerable, and anything unrecognised fails closed as unknown. The fake server
now emits the real tagged shape for every variant.

phase validated the topic but neither the revision nor the queue outcome, so
`--phase enqueued --queue-exit 1` announced that the queue had accepted a
message it rejected, and `--revision 99` recorded a pickup for a revision that
never existed. sent-status then read those records back as "delivery confirmed
by a real turn". Now the revision and binding are checked as the action gate
checks them, a non-zero queue exit records a failed handoff, and a record is
transport evidence only when it carries the proof for its phase - a queue
message id for an enqueue, a turn id for a pickup. Everything else is stored
and reported as an operator claim. sent-status answers for the current
revision by default, so a corrected request no longer reports the fate of the
instruction it replaced, and older revisions stay readable on request.

The handshake is now sequential: initialize is sent and its answer awaited
before the request goes out, so a server that refuses work before
initialization completes cannot silently drop it. The installed v2 protocol
defines no "initialized" notification, so none is sent. A bound hit before the
request is reported as never sent; one hit after it is reported as an unknown
outcome, because those two demand different responses.

Presentation wording now says released for presentation rather than spoken.
Nothing here observes speech.

* no-mistakes(review): harden relay evidence class, performed gate, and step writes

* no-mistakes(review): separate partial-retire exit code, label transport column honestly

* no-mistakes(test): isolate bridge-view child HOME, repair stale fork-surface commit refs

* no-mistakes(test): count claimed pickups apart from turn-id-backed ones

* no-mistakes(document): correct thread-status steerable verdicts in companion docs

* fix(bin): tell the truth about unknown handoffs and recorded references

Independent acceptance rejected the previous head by reading the source
rather than the claim, and it was right: three of the four accepted evidence
corrections were not in it.

A non-zero queue exit was asserted as "nothing was handed off". A timeout, a
killed process or a broken pipe can all follow a message that was already
enqueued, so the only honest outcome is unknown - and unknown is what stops a
blind resend from duplicating the work. A bare non-zero exit now records
handoff-unknown and says the outcome is unknown; a definite non-send needs the
queue's own refusal, passed in --rejection, which records handoff-rejected.

A failed task turn was reported as "the handoff failed; nothing was accepted".
Those are different outcomes: the companion's work failing says nothing about
whether the instruction arrived. The two are now separate records with separate
wording, and a task failure never speaks for the handoff.

An identifier the caller supplies - a queue message id, a turn id - was
labelled verified. This ledger never calls the transport, so it has checked
nothing: those are references, and the label, the verdicts and the legend now
say so. The counts line reports handoffs-recorded, pickups-with-turn-id and
pickups-claimed-only, because nothing here observed a turn.

The handshake claim was also wrong. "initialized" is the installed protocol's
sole client notification - defined at the top level of the generated schema,
not inside the v2 subtree, so the earlier grep concluded absence from looking
in one place. The documented sequence is now sent in full: initialize, await
its answer, initialized, then the request, with a fake server that refuses
anything arriving before both.

Every one of these is reproduced against the fixed source in the task's
private evidence before being claimed.

* no-mistakes(review): gate step writes, refuse dropped refusals, make rebind atomic

* no-mistakes(document): note spoken relay in README documentation index

* no-mistakes(document): correct step scope and rebind archive wording in relay help

* no-mistakes(lint): quote empty NVM_BIN assignment to satisfy ShellCheck SC1007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant