Skip to content

fix(schema): x-openregister-agent-context was dropped at save — every agent leaf resolved an empty context - #2167

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/agent-context-vocabulary
Jul 27, 2026
Merged

fix(schema): x-openregister-agent-context was dropped at save — every agent leaf resolved an empty context#2167
rubenvdlinde merged 1 commit into
developmentfrom
fix/agent-context-vocabulary

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Fixes #2164.

The defect

x-openregister-agent-context was absent from Schema::ANNOTATION_VOCABULARY, so validateConfigurationEntry() silently dropped it on save. Hermiq's AgentContextBuilder (and its JS twin src/utils/agentContext.js) read exactly that key to bound what object data reaches an LLM — so every agent leaf on every schema fleet-wide resolved an empty context.

Fail-closed, so never a leak: an absent allowlist means "expose nothing". But the capability was wholly inert, and invisible by construction — the schema saved with HTTP 200, no validation error reached the caller, and the only signal was a log line.

This is the fourth recurrence

The list already carries explanatory comments for x-openregister-processing, x-openregister-contextchat and x-openregister-shareable — each added after the same bug. That pattern is worth a structural fix (a test asserting every key READ anywhere in the fleet is present in the vocabulary), which I have deliberately not bundled here; this PR stays a one-key fix plus its regression tests.

Verification

Live, against the running dev instance — a PUT of an allowlist onto the hydra-cache finding schema:

BEFORE agent-context: ABSENT — dropped
AFTER  agent-context: ['findingId','severity','gate','rule','status','stageName']

Unit: SchemaAnnotationVocabularyTest 8/8 green (2 new — flat allowlist and the per-property refinement form, each asserting the key survives the round-trip AND is not reported as dropped).

Note: tests/Unit/Db/ has 7 pre-existing failures, all in SchemaLinkedTypes* (linkedTypes validation) — a different code path, untouched by this change, which adds one string to a const array.

🤖 Generated with Claude Code

…Y (or#2164)

The per-schema agent-context allowlist was absent from ANNOTATION_VOCABULARY, so
validateConfigurationEntry() silently dropped it on save. Because Hermiq's
AgentContextBuilder (and its JS twin src/utils/agentContext.js) read exactly that
key, EVERY agent leaf on EVERY schema fleet-wide resolved an EMPTY context.

Fail-closed, so never a data leak — an absent allowlist means 'expose nothing' —
but the capability was wholly inert, and invisible by construction: the schema
saved with HTTP 200, no validation error reached the caller, and the only signal
was a log line.

This is the FOURTH recurrence of the same defect class in this list, after
x-openregister-processing, x-openregister-contextchat and x-openregister-shareable,
each of which carries its own comment saying so. Adds two regression tests (flat
allowlist and the per-property refinement form) asserting both that the key
survives the round-trip and that it is not reported as dropped.

Verified live: PUT of an allowlist onto the hydra-cache 'finding' schema now reads
back intact where it previously returned ABSENT.
@rubenvdlinde
rubenvdlinde merged commit 44d4080 into development Jul 27, 2026
19 of 20 checks passed
@rubenvdlinde
rubenvdlinde deleted the fix/agent-context-vocabulary branch July 27, 2026 14:41
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ 00c2263

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 174/174
npm ✅ 555/555
PHPUnit
Newman
Playwright ⏭️

Quality workflow — 2026-07-27 14:46 UTC

Download the full PDF report from the workflow artifacts.

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