BOHICA-LABS / BOHICA-LABS/vsdd-factory

Fresh-context adversary does not reliably detect specs that cite symbols/variants/method-parameters absent from shipped code (phantom-API drift)

Open
#399 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2
Forks
1
Avg merge
6h 43m
Merged PRs (30d)
29

Description

## Summary
The `adversary` sub-agent, given a spec artifact and its corresponding code surface, corroborates spec-cited call forms against shipped signatures. When a spec cites a concrete symbol (an enum variant, a method parameter, a struct field, a trait method identifier) that does NOT EXIST in the shipped code, the adversary can still return CLEAN if the "closest neighbor" call form does exist and the observable outcome the spec describes is achievable via a different mechanism. Result: convergence can pass 3/3 CLEAN on specs that describe phantom APIs the code cannot satisfy. The drift surfaces later at test-writing time when the test-author tries to construct the phantom call and cannot.

## Observed pattern (abstract, generic)
A spec section describes "emit `EventKind::VariantX` on channel Y" where `EventKind::VariantX` does not exist in the enum, but the observable behavior (channel Y fires an existing sibling variant `Z` when the underlying state transition happens) IS what actually occurs. Adversary rules CLEAN because the shipped code produces the correct observable outcome; the phantom symbol name goes unflagged across multiple fresh-context passes.

Similarly, a spec projection to `WaitState::TimedOut` on a rejection path can be unreachable in the shipped mapping (the reject path projects to `WaitState::Failed`), while adversary passes still return CLEAN because the terminal state is reached — just under a different projection name than the spec cites.

## Related but distinct
- A sibling filed issue covers preflight symbol-path accuracy (the orchestrator's dispatch tuple pointing to an existing symbol at the wrong path). This issue is about spec text citing symbols that do NOT EXIST at all.
- A sibling filed issue covers duplicated normative call-sequence sketches drifting under partial fixes. This issue is about the spec-to-code symbol-existence check itself.

## Proposed remediation (either or both)
1. Adversary preflight or dispatch template REQUIRES a "phantom-symbol grep-check": every concrete symbol name (enum variant, method identifier, struct field, trait method) cited in the spec artifacts under review must be grep-findable in the code surface under review, OR flagged as a finding by the adversary.
2. A separate lightweight `spec-code-symbol-coverage` gate before adversarial convergence begins, so phantoms are caught before fresh passes are consumed and before reconciliation ceremony has to run mid-delivery.

## Impact
Without this check, adversarial convergence can close on specs that require phantom API. Downstream test-writing detects the drift and forces a spec reconciliation, wasting the convergence pass count and creating scope-expansion pressure at the moment when the pipeline is most inclined to accept "just add the feature" as a fix (D-6 rule protects against this but only if the orchestrator recognizes the case).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.