Skip to content

feat: add self-improvement gate review contracts - #489

Merged
RNA4219 merged 3 commits into
mainfrom
agent/self-improvement-contracts
Jul 12, 2026
Merged

feat: add self-improvement gate review contracts#489
RNA4219 merged 3 commits into
mainfrom
agent/self-improvement-contracts

Conversation

@RNA4219

@RNA4219 RNA4219 commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • add canonical repo responsibility manifest
  • add self-improvement/v1 schemas and gate effectiveness analysis
  • add governance checks, documentation, Birdseye, and acceptance records

Intent: INT-WFC-SELF-IMPROVEMENT-20260712
Priority Score: 5

EVALUATION

Docs matrix

  • REQUIREMENTS: present? [x] yes / [ ] later
  • SPEC: present? [x] yes / [ ] later
  • DESIGN: present? [x] yes / [ ] later

Validation

  • uv run pytest -q (611 passed)
  • uv run ruff check .
  • Birdseye freshness and repo responsibility checks

Risk and rollback

  • self-improvement remains non-blocking and review-only
  • rollback by reverting this PR

@github-actions

Copy link
Copy Markdown

Spec Matrix
REQUIREMENTS ✅ / SPEC ✅ / DESIGN ✅

  • 不足があればラベルを付与します(非ブロッキング)。
  • Issue自動起票は label: auto-task 付きPRのみ。

@github-actions

Copy link
Copy Markdown

📚 Docs Resolve Result

⚡ Warnings

  • No task_id found in PR

Generated by docs-resolve-pr-gate workflow

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +19 to +21
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)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@RNA4219
RNA4219 merged commit 8b4d5ff into main Jul 12, 2026
36 checks passed
@RNA4219
RNA4219 deleted the agent/self-improvement-contracts branch July 12, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant