Skip to content

fix(agentic-engineering): validate ad hoc gh JSON fields at the Surveyor call site #176

Description

@devantler

🤖 Generated by the Agent Improver

Observed failure

The consumer-wide H59 rule intended to stop cross-subcommand gh --json field reuse, but the post-intervention target moved in the wrong direction: 11 genuine Unknown JSON field failures across 3 Claude sessions in the latest 24-hour window, versus the 1-per-46-session baseline. All 11 failures were Surveyor reads that requested an unsupported field from gh run list; none was prose, a negative control, or documentation.

The portable Surveyor entrypoint does not carry the exact-subcommand vocabulary preflight, so the consumer rule is too far from the caller. A rejected field list aborts the whole request and can be misread as an empty result.

Proposed repair

  • Put the preflight in the portable portfolio-surveyor Safety contract.
  • For prescribed reads, keep the reviewed literal field list.
  • Before any ad hoc JSON read, discover fields from that same subcommand with bare --json, validate every requested field, and never transfer field names across subcommands.
  • Treat a failed vocabulary probe or validated read as QUERY-UNKNOWN, never as an empty result.
  • Add a focused contract test and bump the agentic-engineering plugin cache key.

Acceptance

  • RED proves the current entrypoint lacks the call-site contract.
  • GREEN and ablation prove all four clauses are required.
  • Plugin validation, manifest parity, version-bump, and script tests pass.
  • The next hypothesis measures the exact error signature after rollout; safety and cross-lane coordination remain QUERY-UNKNOWN until independently measurable.

Upstream repair for devantler-tech/monorepo#3049.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions