Skip to content

feat(guardian): implement specification-driven review - #624

Merged
fishmingyu merged 10 commits into
mainfrom
feat/guardian-specification-review
Aug 15, 2026
Merged

feat(guardian): implement specification-driven review#624
fishmingyu merged 10 commits into
mainfrom
feat/guardian-specification-review

Conversation

@Cyoyuu

@Cyoyuu Cyoyuu commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Rework Repository Guardian around evidence-backed local-specification discovery and contract-driven patch review. The implementation uses independent cheap-model explorers, strong-model aggregation, persistent cross-cycle specification memory, targeted runtime probes, and commit-addressed delivery back to the coding agent.

Changes

  • add structured planning, discovery, aggregation, distillation, frontier selection, and patch-checking stages;
  • preserve specification identity, provenance, evidence freshness, failed probes, review experience, and token usage across solver revisions;
  • normalize and repair evidence before admission while retaining authoritative verbatim task context;
  • execute a bounded set of contract-driven probes and make their observed outcomes authoritative;
  • retry malformed explorer output and emit experimental-only overlap, contribution, subset-coverage, redundancy, and discovery-probability artifacts;
  • synchronize commit-scoped Guardian reports with solver checkpoints and account for resumed solver invocations cumulatively;
  • keep artifacts outside the reviewed workspace, bound explorer contribution analysis and model output, and reject noncanonical exchange filenames;
  • extend the DeepSWE launcher, metadata, and tests for role-specific models and the new review lifecycle.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Performance improvement
  • Tests

Testing

  • Tests pass locally

  • Added new tests for the changes

  • pytest -q test/clients/test_execution.py test/clients/test_guardian.py test/clients/test_guardian_exchange.py test/clients/test_guardian_memory.py test/guardian/deepswe --tb=short — 133 passed.

  • Unit tier — 5430 passed, 71 skipped, 191 deselected. The isolated worktree omitted one local distribution-metadata assertion because its host installation was still 0.2.0; the same assertion passes in the current main worktree with 0.2.1 metadata.

  • Changed-file pre-commit hooks and git diff --check passed.

  • Earlier real DeepSWE smoke: igel-persist-feature-schema, Terra solver/aggregator, five Luna explorers, one Guardian cycle — reward 1.0, F2P 24/24, P2P 2/2, Guardian complete and not degraded.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

@github-actions github-actions Bot added type/test Test-related scope/eval Evaluation, baselines, experiment scripts labels Aug 14, 2026
Cyoyuu and others added 10 commits August 15, 2026 15:14
Add evidence-backed local-specification exploration, aggregation, memory, patch checking, and cross-cycle delivery. Preserve runtime probes and cumulative solver accounting, and cover the revised DeepSWE workflow with focused tests.
Bind one-specification probes to authoritative trajectory commands, derive outcomes from exit codes, persist stable probe identity across commits, and reject ambiguous evidence. Preserve compatibility with existing Guardian memory and cover marker recovery, inconclusive runs, duplicate rejection, and supersession.
Allow one read-only, non-executing repair of malformed probe references while deriving outcomes from the original command trajectory. Preserve valid probes when sibling evidence is malformed and expose deterministic probe acceptance and rejection metrics in artifacts.\n\nVerified with 81 focused Guardian and DeepSWE tests plus Black, isort, flake8, and git diff checks.
Resolve specification identity by normalized statement and condition before accepting aggregator-selected IDs. Prevent an incoming record from rewriting an existing specification and preserve equal statements under distinct conditions.\n\nThis ports the reviewed PR #532 memory invariant to the newer structured specification-memory architecture. Verified with 83 focused Guardian and DeepSWE tests plus Black, isort, flake8, and git diff checks.
Materialize verbatim task context cited by the aggregator into the host-owned evidence ledger and canonicalize the patch-checker alias form. This prevents explicit requirements from being rejected merely because an explorer did not duplicate the task citation.\n\nVerified with 85 focused Guardian and DeepSWE tests plus Black, isort, flake8, and git diff checks.
Read completed review responses directly by requested commit so solver relaunch does not race the latest-report projection. Ignore terminal responses that did not perform a review.\n\nVerified with 88 focused Guardian harness and client tests.
Make the host controller the sole writer of the durable reviewed-commit head and recover it only when a matching completed episode proves the review. Preserve the prior head across failed, superseded, and cycle-limit responses.\n\nVerified with 89 focused Guardian harness and client tests.
Require lifecycle probes to separate the configured output directory from the invocation working directory, validate every contract-named artifact, and resolve metadata references within the same artifact set. This exposes current-working-directory fallbacks like the IGEL two-cycle failure.\n\nVerified with 89 focused Guardian harness and client tests.
Add retryable structured discovery, experimental explorer-contribution artifacts, bounded contract-driven probes, authoritative executed verdicts, and safer report-delivery synchronization. Preserve candidate-scoped identities and cumulative solver accounting across review cycles.\n\nVerified with 125 focused Guardian and DeepSWE tests plus Black, isort, flake8, and git diff --check.
Keep review artifacts outside the repository, enforce explorer and model-output limits before contribution analysis, and accept only canonical commit-addressed exchange filenames.

Verified with 133 focused tests, the unit tier (5430 passed), and the changed-file pre-commit hooks.
@fishmingyu
fishmingyu force-pushed the feat/guardian-specification-review branch from 10d3d60 to d12c239 Compare August 15, 2026 22:26
@fishmingyu
fishmingyu merged commit 912229f into main Aug 15, 2026
15 checks passed
@fishmingyu
fishmingyu deleted the feat/guardian-specification-review branch August 15, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/eval Evaluation, baselines, experiment scripts type/test Test-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants