Skip to content

Coverage ledger accepts ordinary classes absent from their hunter assignments #126

Open

Description

@maqalaqil

At c1c8a8c, an otherwise valid covered ledger unit can claim ATTACK-CLASSES.md#Access control while its ordinary_attack_class_block is null or ATTACK-CLASSES.md#Injection. The coverage validator returns no errors in both cases.

That is a mismatch between the coverage claim and the instructions actually sent to the hunter: RECONNAISSANCE.md defines the canonical attack class as the exact block reference, and HUNTING.md builds the hunter prompt from the assignment map. The validator currently checks those fields independently.

A reproduction using the existing fixtures in validate-coverage-ledger.test.cjs:

const value = unit({
  status: "covered",
  agent_id: "hunter-1",
  reviewed_paths: ["src/router.ts"],
  local_checks: [sourceCheck()],
  ordinary_attack_class_block: "ATTACK-CLASSES.md#Injection",
});
// unit() sets canonical_refs.attack_class to ATTACK-CLASSES.md#Access control.
console.log(errorsFor([value])); // [] on main
value.ordinary_attack_class_block = null;
console.log(errorsFor([value])); // [] on main

The same acceptance occurs for in_progress, blocked, and candidate units with otherwise valid state evidence.

A narrow fix is to require exact equality for ordinary ATTACK-CLASSES.md#... references in those four assigned/reviewed states. A planned unit can still be incomplete while being prepared, but must have the correct block before its transition to in_progress passes validation. Leave all unassigned states and custom/companion class representations unchanged.

Related but distinct: #104 rejects a block selected and excluded simultaneously; it does not connect the canonical coverage class to the selected ordinary block. I applied its current patch alongside this proposed fix in a temporary checkout, and all 78 tests pass together.

This is ledger consistency, not a claim about a deployed system. A focused fix with failing-before/passing-after regression tests is ready.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions