Skip to content

refactor: add semantic diffing and affected-obligation routing #334

Closed

Description

@Sinity

Parent

Part of #330. Depends on #192.

Context

A major workflow failure is that agents do not know which focused verification proves a change. Path-based routing is useful but too crude: the system should distinguish parser semantic changes, schema annotation changes, operation-effect changes, generated-surface changes, presentation-only changes, and workflow/governance changes.

Scope

Add semantic diffing and affected-obligation routing:

  • classify changed source spans into ChangeSubject rows;
  • map change subjects to proof obligations through subject provenance, artifact graph nodes, operation specs, and schema annotations;
  • render obligation diffs across git refs: new, dropped, now-failing, now-passing, stale-evidence, suppressed;
  • expose recommended local checks for agent inner loops;
  • keep full PR/deployment gates explicit.

Workflow claims

Repo/process artifacts are also subjects when they make durable claims:

  • PR body lists verification actually run;
  • non-trivial PR references an issue where policy requires it;
  • scratch/thoughtspace entries with durable value are promoted or retired;
  • generated surfaces are current after source changes;
  • claims like "complete", "aligned", "unified", or "green" have supporting evidence.

Acceptance criteria

  • A changed-path/ref input produces deterministic affected obligations for at least parser, schema, command, and generated-surface changes.
  • Output explains why each obligation was selected.
  • Obligation diffs across two refs render in machine-readable and human-readable form.
  • The report distinguishes inner-loop checks from PR/deployment gates.
  • At least one workflow claim is represented in the catalog without coupling runtime code to GitHub.

Activity

  1. added
    type:refactor
    theme:verifiability
    theme:agent-workflow
    phase:migration
    on Apr 21, 2026
  2. changed the title [-]refactor: route affected probes from operation and artifact graph[/-] [+]refactor: add semantic diffing and affected-obligation routing[/+] on Apr 22, 2026
  3. added
    theme:proof-kernel
    area:devtools
    on Apr 22, 2026
  4. Sinity commented on Apr 22, 2026

    @Sinity
    OwnerAuthor

    Implementation checkpoint:

    • Added catalog subjects for declared operation specs and durable workflow claims.
    • Added catalog claims for operation routing metadata, generated-surface freshness, and PR verification records.
    • Added polylogue.proof.diffing to classify changed paths, route affected proof obligations, bucket obligation diffs, and render human/JSON reports.
    • Added devtools affected-obligations with --base-ref, --head-ref, repeated --path, and --json.
    • Covered parser, schema, command, generated-surface, operation-spec, and diff-bucket routing with focused tests.

    Focused verification so far:

    pytest -q -n 0 tests/unit/proof/test_catalog.py tests/unit/proof/test_diffing.py tests/unit/devtools/test_affected_obligations.py tests/unit/devtools/test_command_catalog.py
    ruff format --check polylogue/proof devtools/affected_obligations.py tests/unit/proof/test_diffing.py tests/unit/devtools/test_affected_obligations.py
    ruff check polylogue/proof devtools/affected_obligations.py tests/unit/proof/test_diffing.py tests/unit/devtools/test_affected_obligations.py
    mypy polylogue/proof devtools/affected_obligations.py tests/unit/proof/test_diffing.py tests/unit/devtools/test_affected_obligations.py
    pytest -q -n 0 tests/unit/proof tests/unit/devtools/test_affected_obligations.py tests/unit/devtools/test_command_catalog.py tests/unit/devtools/test_render_verification_catalog.py tests/unit/operations/test_specs.py
    devtools render-all --check
    devtools affected-obligations --path docs/verification-catalog.md --json
    devtools affected-obligations --path polylogue/sources/parsers/codex.py
    

    Next: broader quick/full gate, then PR.

  5. added a commit that references this issue on Apr 22, 2026
    b53ae96
  6. Sinity commented on Apr 22, 2026

    @Sinity
    OwnerAuthor

    Closed by PR #346: #346

    Squash merge: b53ae960f841229e7d73c4d9b57391e40fe41986

    Verification before merge:

    pytest -q -n 0 tests/unit/proof/test_catalog.py tests/unit/proof/test_diffing.py tests/unit/devtools/test_affected_obligations.py tests/unit/devtools/test_command_catalog.py
    ruff format --check polylogue/proof devtools/affected_obligations.py tests/unit/proof/test_diffing.py tests/unit/devtools/test_affected_obligations.py
    ruff check polylogue/proof devtools/affected_obligations.py tests/unit/proof/test_diffing.py tests/unit/devtools/test_affected_obligations.py
    mypy polylogue/proof devtools/affected_obligations.py tests/unit/proof/test_diffing.py tests/unit/devtools/test_affected_obligations.py
    pytest -q -n 0 tests/unit/proof tests/unit/devtools/test_affected_obligations.py tests/unit/devtools/test_command_catalog.py tests/unit/devtools/test_render_verification_catalog.py tests/unit/operations/test_specs.py
    devtools render-all --check
    devtools affected-obligations --path docs/verification-catalog.md --json
    devtools affected-obligations --path polylogue/sources/parsers/codex.py
    devtools affected-obligations --base-ref master --head-ref HEAD
    devtools verify --quick
    devtools verify
    pre-push quick gate
    

    Remote checks green at merge time: PR policy, GitGuardian, CodeRabbit, lint, typecheck, showcase verify, Nix build/check, and CodeQL. Python matrix jobs were still in progress without actionable failures; merged based on the clean full local gate and the CI-quota guidance.

  7. added 4 commits that reference this issue on Apr 22, 2026
    36b9b34
    93285dd
    6f41835
    5f64f0c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:devtoolsarea:qaphase:migrationtheme:agent-workflowtheme:proof-kerneltheme:verifiabilitytype:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions