feat: add self-improvement gate review contracts - #489
Conversation
|
Spec Matrix
|
📚 Docs Resolve Result⚡ Warnings
Generated by docs-resolve-pr-gate workflow |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97d83362b3
ℹ️ 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".
| run: python -m tools.ci.governance_gate | ||
| - name: Repository responsibility ownership | ||
| if: steps.changes.outputs.code == 'true' | ||
| run: python tools/ci/check_repo_responsibilities.py --check |
There was a problem hiding this comment.
Install dependencies before the responsibility check
For code-changing PRs in this workflow, the only setup before this new command is actions/setup-python; there is no pip install/uv sync step before line 52. tools/ci/check_repo_responsibilities.py imports yaml at module import, so a fresh runner/minimal checkout fails with ModuleNotFoundError: No module named 'yaml' before the manifest is checked, blocking the governance gate for otherwise valid code PRs.
Useful? React with 👍 / 👎.
| from typing import Any | ||
|
|
||
| import yaml | ||
| from jsonschema import Draft202012Validator, FormatChecker |
There was a problem hiding this comment.
Avoid importing dev-only jsonschema for every subcommand
When users install only the project runtime dependencies and run existing commands like export-memory or build-recall, this top-level import runs before argparse dispatch even though only analyze-gates needs schema validation. jsonschema is currently declared only in the dev extra in pyproject.toml, so these previously-stdlib commands now fail at startup unless dev dependencies are installed; move the import into the analyze-gates branch or make it a runtime dependency.
Useful? React with 👍 / 👎.
| since, until, days = _observation_period(bundle) | ||
| task_count = _as_int(bundle.get("task_count"), default=0) | ||
| observations = [item for item in bundle.get("gate_observations", []) if isinstance(item, dict)] |
There was a problem hiding this comment.
Filter observations to the requested observation window
The analyzer computes since/until, but the gate and evidence aggregations use every observation in the bundle without checking occurred_at against that window. If a shipyard export or replay includes older records alongside the current period, old generated Evidence or gate evaluations are counted as current and can produce false unread/no-effect/override nudges, despite the new requirement to aggregate only observations in the observation period.
Useful? React with 👍 / 👎.
Summary
Intent: INT-WFC-SELF-IMPROVEMENT-20260712
Priority Score: 5
EVALUATION
Docs matrix
Validation
Risk and rollback