Skip to content

A reference can be read by the agent instead of Gemini - #25

Merged
rponeawa merged 1 commit into
mainfrom
feat/reference-observer-choice
Aug 21, 2026
Merged

rponeawa merged 1 commit into
mainfrom
feat/reference-observer-choice

Conversation

@rponeawa

Copy link
Copy Markdown
Member

Reconstruction required Google Vertex credentials to do anything at all — every observation went through one Gemini call, so a machine without the pair could not start the route. The main agent can read pictures, and a shot is a picture if its frames are tiled into one.

The choice

prepare_reference --observer gemini|agent, answered once per reference and recorded in its state.

gemini is unchanged and remains the default. It uploads the shot clips and the whole video, and it hears the sound.

agent reaches no Provider. The CLI prepares the same media, adds one tile per shot — the shot's frames sampled evenly across its duration, laid out in reading order — and returns each observation as a task carrying its key, instruction, prompt and image_refs. record_observation takes the answer back.

The keys, the prompts and the cache file are the same on both paths, so continuity.md, vocabulary.md, final-sources.md and the convergence loop read one shape and never learn which observer produced it. The evidence is translated rather than reworded: a shot's clip becomes that shot's tile, the whole video becomes the storyboard that already existed.

Observation gains a pending status — a task handed out, not an answer received. It is never cached, so an unanswered observation is asked again instead of a placeholder being read as complete.

Sound, stated rather than papered over

WhisperX still measures every word locally on both paths, so Segment durations are unaffected. A question that needs sound carries a note saying the observer cannot hear it, and asks for what the pictures and the transcript support with the rest marked undetermined — because a voice inferred from an appearance is exactly what continuity.md forbids.

The blindness rule is scoped, not dropped

reconstruction-loop.md rests on the comparer not knowing what was built. On the gemini observer that holds unchanged and the prohibition on opening the reference frame yourself stands. On the agent observer the comparer is the builder, so observers.md states the discipline that replaces it: write the differences down before naming a cause, count only repairs aimed at one that was written down, and read a quantity off the frame rather than spending an attempt guessing at it.

The route asks

The path question is asked once, before anything runs, and it is the only question this route asks about how it runs — the working directory, the project location, the vocabulary and the generators are still its own to decide. index.md's credentials rule changes from "name the missing variable and stop" to "the Vertex pair selects an observer rather than blocking one"; every other missing credential still stops the route.

Verification

Path A, unchanged:

Check Result
The 8 pre-existing package tests pass, untouched
Real CLI, no credentials, default observer exit 1, GOOGLE_CLOUD_PROJECT is required — same message and code as before
Real CLI, malformed credential JSON exit 1, GOOGLE_APPLICATION_CREDENTIALS_JSON is not valid JSON

Path B, driven end to end against a three-shot video with both Vertex variables unset:

Step Result
prepare_reference --observer agent 3 shots detected, 3 tiles written, 4 whole-reference observations returned as tasks, transcript reported unavailable without WhisperX
observe_reference 11 tasks emitted; visual:shot-002 carried 002-frames.jpg, 002-representative.jpg, 001-tail.jpg and no video; audio:shot-002 carried the tile alone and the no-sound note
Reading the tile 5 frames at 0.240s, 0.840s, 1.440s, 2.040s, 2.640s — evenly spaced, reading order confirmed from the burned-in timecodes
record_observation --text-file stored in observations; re-running observe_reference reported visual:shot-002 complete and dropped it from the pending list, the other 10 still owed
Mismatched observer refused: was prepared for the agent observer; --redo all re-prepares it for the other one

3 new tests cover the agent path. 14/14 pass. npx tsc -p tsconfig.json --noEmit is clean outside examples/, where it fails identically before and after. Tiling adds about one ffmpeg decode per shot; a 9-second three-shot prepare takes 1.07s in total.

Not verified: a real Vertex round trip, which this machine has no credentials for. Path A's behaviour is covered by the tests and by its unchanged failure modes, not by a live call.

Reconstruction required Google Vertex credentials to do anything at all: every
observation went through one Gemini call, so a machine without the pair could
not start the route. The main agent can read pictures, and a shot is a picture
if its frames are tiled into one, so it can do the reading itself.

prepare_reference now takes --observer. `gemini` is unchanged and remains the
default: it uploads the clips and the whole video, and it hears the sound.
`agent` reaches no Provider. The CLI prepares the same media, adds one tile per
shot — the shot's frames sampled evenly and laid out in reading order — and
returns each observation as a task carrying its prompt and the pictures to
answer it from. record_observation takes the answer back. The keys, the prompts
and the cache are the same on both paths, so continuity, vocabulary,
final-sources and the convergence loop read one shape and never learn which
observer produced it.

The evidence a request would have uploaded is translated rather than reworded: a
shot's clip becomes that shot's tile, the whole video becomes the storyboard.
Observation gains a `pending` status, which is a task handed out rather than an
answer received and is never cached, so an unanswered observation is asked again
instead of reading a placeholder as complete.

Sound is the one thing that does not translate, and the route says so rather
than pretending otherwise. WhisperX still measures every word locally on both
paths. A question that needs sound carries a note saying the observer cannot
hear and to state what could not be determined instead of inferring a voice from
an appearance.

The blindness rule the loop rests on is now scoped rather than dropped. On the
gemini observer the comparer is not the builder and the prohibition stands
unchanged. On the agent observer it is, so observers.md states the discipline
that takes its place: write the differences down before naming a cause, count
only repairs aimed at one that was written down, and read a quantity off the
frame rather than spending an attempt on it.

The route asks the author which observer to use, once, before anything runs.
That is the only question it asks about how it runs; the working directory, the
project location, the vocabulary and the generators are still its own to decide.
@rponeawa
rponeawa merged commit 32600bb into main Aug 21, 2026
2 checks passed
@rponeawa
rponeawa deleted the feat/reference-observer-choice branch August 21, 2026 12:12
overlordkim pushed a commit that referenced this pull request Sep 9, 2026
A reference can be read by the agent instead of Gemini
overlordkim pushed a commit that referenced this pull request Sep 9, 2026
A reference can be read by the agent instead of Gemini
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