Skip to content

feat(interfacectl): add target-acquisition and runtime observation validation#39

Merged
mikeylong merged 2 commits intomainfrom
codex/fitts-law-target-acquisition
Mar 22, 2026
Merged

feat(interfacectl): add target-acquisition and runtime observation validation#39
mikeylong merged 2 commits intomainfrom
codex/fitts-law-target-acquisition

Conversation

@mikeylong
Copy link
Copy Markdown
Collaborator

Summary

  • add validator support for target-acquisition, flow, and feedback-recovery contract metadata
  • carry those policies through compile, generation, and runtime payloads with repair guidance
  • validate browser-observed targets, flows, and async states through static markers and remote observation

Testing

  • pnpm run build
  • pnpm run test

@mikeylong mikeylong merged commit 4314151 into main Mar 22, 2026
2 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3f2225a73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +604 to +608
const dataset = node?.dataset ?? {};

return {
id:
String(dataset.contractTarget ?? dataset.contractInteraction ?? "").trim() ||
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Carry target override identifiers through remote observation

observeRemotePage() only serializes a remote target's synthesized id here, so by the time mapRemoteObservationTargets() reaches evaluateSurfaceCompliance(), the validator no longer has interactionId, componentId, viewportId, or contextId. That breaks both resolveTargetAcquisitionOverride() and resolveTargetAcquisitionPolicy(): any surface that relies on a per-interaction exception or a viewport/context-specific budget will be validated against the base surface budget during --remote-url, producing false target-* violations for contracts that are actually compliant.

Useful? React with 👍 / 👎.

Comment on lines +1065 to +1067
const missingMetrics: string[] = [];
const requiredMetrics = ["boundingBox", "edgeInsetPx"];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Treat missing neighbor-gap metrics as unobservable

This unobservable check only requires boundingBox and edgeInsetPx, but both spacing rules below depend on nearestNeighborGapPx. In the non-remote path buildInteractiveTargetDescriptor() leaves nearestNeighborGapPx as null unless authors add an explicit data-contract-target-gap, so multi-control surfaces can silently skip target-gap-too-tight and destructive-target-too-close without any target-unobservable finding. That means a large part of the new target-acquisition policy is not enforced in ordinary static validation.

Useful? React with 👍 / 👎.

Comment on lines +1232 to +1235
if (state.id === context.id) {
return true;
}
return state.kind === context.kind;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop matching every same-kind feedback context

findMatchingFeedbackContexts() falls back to state.kind === context.kind even after a state has an explicit id/context that does not match this context. Because the schema only requires context ids to be unique, a valid contract can declare multiple error or loading contexts; in that case one observed state will be validated against all same-kind contexts and can emit spurious feedback-* violations for requirements that belong to a different context.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant