feat: compile consumer sync into one typed normalized plan - #2756
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR adds a typed manifest compiler and deterministic consumer sync plan, migrates workflows and validators to the plan, adds schema and tests, updates synced PR-context scripts, and documents the compiler contract. ChangesConsumer sync plan
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Manifest as sync-manifest.yml
participant Compiler as sync_manifest_compiler.py
participant Validator as check_consumer_sync_drift.py
participant Workflow as maint-68-sync-consumer-repos.yml
participant ConsumerRepo as Consumer repository
Manifest->>Compiler: compile and validate YAML
Compiler-->>Validator: typed manifest and removals
Compiler-->>Workflow: deterministic consumer-sync-plan/v1
Workflow->>ConsumerRepo: copy resolved sources to targets
Validator->>ConsumerRepo: compare compiled targets with remote files
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR centralizes consumer sync-manifest interpretation by introducing a typed Python compiler that normalizes .github/sync-manifest.yml into a deterministic workflows.consumer-sync-plan/v1 JSON plan, then migrates sync/drift/validation surfaces to consume that normalized output so precedence and deliverability checks are consistent.
Changes:
- Add
scripts/sync_manifest_compiler.pyto compile/validate the manifest into a typed, deterministic plan with stable hashes/fingerprints and early failure on invalid entries. - Update Maint 68 sync and drift/template-sync validators to use the compiled plan (single source of truth for resolved sources/targets and template hash).
- Add schema + unit tests validating precedence, safety checks, duplicates, deterministic output, and real-manifest compilation.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/scripts/test_validate_template_sync.py | Updates test harness to copy the new compiler dependency alongside the validator. |
| tests/scripts/test_sync_manifest_compiler.py | Adds unit coverage for compiler behavior, determinism, CLI outputs, and real-manifest validation against JSON schema. |
| tests/scripts/test_check_consumer_sync_drift.py | Refactors drift tests to use typed manifest entries/compiled manifest instead of untyped dicts/YAML parsing. |
| scripts/validate_template_sync.py | Switches template-sync validation to compile the manifest first and operate over typed entries. |
| scripts/sync_manifest_compiler.py | Introduces the typed manifest compiler + deterministic plan/CLI + safety/uniqueness validation. |
| scripts/check_consumer_sync_drift.py | Migrates drift checker to consume the compiled manifest and canonical source resolution. |
| docs/ops/CONSUMER_REPO_MAINTENANCE.md | Documents the new compiler/plan contract, fields, determinism, and validation workflow integration. |
| docs/contracts/schemas/consumer-sync-plan-v1.schema.json | Adds the machine-readable JSON schema for the normalized plan. |
| .github/workflows/maint-68-sync-consumer-repos.yml | Compiles the manifest into manifest.json, uses normalized resolved_source/target, and derives template hash from plan output. |
| .github/workflows/health-70-validate-sync-manifest.yml | Adds an explicit “compile to plan JSON” validation step for PRs touching the manifest. |
| .github/sync-manifest.yml | Removes a duplicate .github/scripts/agents-guard.js entry from the scripts: section (now enforced by duplicate-target checks). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c17f04c994
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Automated Status SummaryHead SHA: 4c94048
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Low Coverage Files (<50.0%)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScope
Context for AgentRelated Issues/PRsTasks
Acceptance criteria
|
|
Runner dispatch state for autofix on PR #2756. Do not edit. |
🤖 Keepalive Loop StatusPR #2756 | Agent: Codex | Iteration 0/12 Current State
🔍 Failure Classification| Error type | infrastructure |
|
Keepalive Work Log (click to expand)
|
|
Resolved the remaining cyclic-symlink review finding in |
…ion paths Introduces scripts/sync_manifest_compiler.py — a single, typed, deterministic parser for .github/sync-manifest.yml. Every caller that previously did raw yaml.safe_load() + dict.get() guessing now uses compile_manifest(), which validates all entries and raises ManifestCompileError before any consumer mutation can happen. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
533f5e6 to
e788692
Compare
|
Runner dispatch state for codex on PR #2756. Do not edit. |
|
Closer recovery: fixed the Python 3.13-only cyclic-symlink gap in |
Provider Comparison ReportProvider Summary
📋 Full Provider Details (click to expand)openai
anthropic
Agreement
Disagreement
Unique Insights
🔍 LangSmith Traces |
Closes #2751
Automated Status Summary
Scope
.github/sync-manifest.yml.Context for Agent
Related Issues/PRs
Tasks
Acceptance criteria
Summary by CodeRabbit