Skip to content

feat(prompts): rank the session's standing context for the writer - #21

Merged
pmanko merged 2 commits into
mainfrom
feat/session-context-prompt
Aug 24, 2026
Merged

feat(prompts): rank the session's standing context for the writer#21
pmanko merged 2 commits into
mainfrom
feat/session-context-prompt

Conversation

@pmanko

@pmanko pmanko commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Companion to Catalyst Phase 1 (delivery gate G4 — layered context). Catalyst now sends revision.sessionContext: guidance a person pinned to the session, verified examples from earlier accepted turns, and the one prior failure on the same query.

The writer prompt has to rank them, because position alone is ambiguous to a model. Unlabelled, standing guidance reads either as another entry in the history it is told to ignore, or as an override of the request in front of it — and both readings are wrong.

The prompt now states:

  • guidance — standing requirements to follow without being told again; the current instruction outranks them, and where two conflict the later one wins.
  • verifiedExamples and relevantFailureevidence about this data, not instructions: learn the column names, joins, and mistakes; do not copy their SQL or mistake it for the request.
  • the approved catalog and read-only policy outrank every part of it.

Catalyst withholds the layer entirely from a Hub that does not advertise catalyst.query.session-context.v1, so this prompt and that capability ship together.

Evidence: 692 passed. The new test pins each layer's name and its stated precedence, so a future edit cannot quietly drop the ranking.

Catalyst Phase 1 sends pinned guidance, verified examples from earlier
turns, and the previous failure on the same query. Position alone is
ambiguous: without being told, standing guidance reads either as another
old instruction to ignore or as an override of the request in front of
it, and both are wrong.

Guidance is now stated as standing requirements that the current
instruction outranks, with the later entry winning a conflict. Examples
and failures are named as evidence about this data -- learn the columns,
joins, and mistakes, do not copy the SQL or mistake it for the request.
The catalog and the read-only policy outrank all of it.
Catalyst's generation grammar has admitted three statuses since G3b, but
this prompt still said the stage was "constrained to a `ready` candidate".
A branch the prompt forbids is a branch the writer never takes: the only
way out of an ambiguous or unanswerable question was to invent a query for
it, which is the failure Phase 1 exists to remove.

State all three answers and when each applies. `ready` stays the expected
one. `needs_clarification` is for a request this catalog could answer if we
knew which answer was meant -- ask the shortest settling question, name the
choices, do not guess a default. `unsupported` is for a request no query
over the approved views could answer however worded, and explicitly not for
a concept the writer merely failed to find: model exhaustion is a reason to
ask, never a claim about the data.

Also state what a revision with no `editorSnapshot` means. That request
shape now exists -- it is a person answering the question the writer asked,
on a session that holds no query -- and without a rule for it the writer
would apply "revise the editor artifact" to an editor that is not there.
@pmanko
pmanko merged commit 34450e3 into main Aug 24, 2026
5 checks passed
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