Skip to content

fix(ci): require all codex synthesis schema fields#891

Merged
phernandez merged 1 commit into
mainfrom
codex/auto-bm-schema-required
Jun 5, 2026
Merged

fix(ci): require all codex synthesis schema fields#891
phernandez merged 1 commit into
mainfrom
codex/auto-bm-schema-required

Conversation

@phernandez
Copy link
Copy Markdown
Member

Fixes the Auto BM live run failure from PR #890. Codex/OpenAI structured output schemas require every property to appear in required; the generated AgentSynthesis schema now derives required from properties and has a regression assertion.

Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez phernandez merged commit 2de8183 into main Jun 5, 2026
19 of 24 checks passed
@phernandez phernandez deleted the codex/auto-bm-schema-required branch June 5, 2026 01:48
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Claude finished @phernandez's task in 1m 21s —— View job


PR #891 Review: fix(ci): require all codex synthesis schema fields

  • Gathering context and reading changed files
  • Analyzing code changes
  • Evaluating against team checklist
  • Posting review summary

Summary

This is a targeted, correct fix for a live CI failure. OpenAI/Codex structured output schemas require every property to appear in required — the previous hardcoded required list was missing the optional array fields (user_facing_changes, internal_changes, verification, follow_ups, decision_candidates, task_candidates), causing structured output mode to fail at runtime.

The fix has two parts:

  1. "required": list(properties) — derives required dynamically from the same properties dict, so they can never diverge.
  2. assert set(schema["required"]) == set(schema["properties"]) — a regression assertion that will catch any future divergence at test time.

Code Review Checklist

Area Status Notes
Follows Basic Memory coding conventions Clean, targeted diff, no unrelated changes
Python 3.12+ type annotations No new types needed in this fix
100-char line length Compliant
No commented-out code
Unit tests for fix Regression assertion added
100% test coverage render_agent_synthesis_schema is fully covered
No hardcoded secrets
No sensitive data in output
No emojis/unicode in console output
Windows path compatibility ✅ N/A No path comparisons

Key Observations

The fix is correct and idiomatic.

src/basic_memory/ci/project_updates.py:443-449

schema = {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "title": "AgentSynthesis",
    "type": "object",
    "additionalProperties": False,
    "required": list(properties),   # ← derives from dict, stays in sync automatically
    "properties": properties,
}

The dynamic derivation approach (list(properties)) is strictly better than a hardcoded list — it cannot drift as new fields are added to the schema.

The regression assertion is the right guard:

tests/ci/test_project_updates.py:426

assert set(schema["required"]) == set(schema["properties"])

This is exactly the invariant Codex structured output requires. Any future addition of a property without adding it to required will immediately fail the test rather than causing a silent live run failure.

Minor note: sort_keys=True on the json.dumps call means the JSON output is alphabetically sorted. For required, list(properties) preserves Python dict insertion order, so the required array ordering and properties key ordering will differ — but this is fine since Codex only validates the set membership, not ordering.


Verdict

Approved. The fix is minimal, correct, and the regression assertion future-proofs it well. No issues.

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