Skip to content

Add OpenCode native questionnaire adapter - #9

Merged
kossoy merged 4 commits into
mainfrom
issue-3-opencode-adapter
Aug 31, 2026
Merged

kossoy merged 4 commits into
mainfrom
issue-3-opencode-adapter

Conversation

@kossoy

@kossoy kossoy commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3.

Outcome

  • adds the OpenCode question adapter over the canonical immutable frontier contract
  • maps the exact ordered string[][] response shape, multiple, custom answers, and final confirmation
  • probes the installed OpenCode version while requiring observed tool exposure, permission, and response transport; command names such as opencode run are diagnostic only
  • generates a linked grill-me / grilling OpenCode bundle with deterministic bytes and retained upstream MIT notice
  • proves both skills are discoverable together in an isolated .opencode/skills root

Verification

  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest tests.test_opencode_adapter tests.test_opencode_generation -v — 16 passed
  • python3 /home/god/.codex/skills/.system/skill-creator/scripts/quick_validate.py harnesses/opencode/skills/grill-me — valid
  • python3 /home/god/.codex/skills/.system/skill-creator/scripts/quick_validate.py harnesses/opencode/skills/grilling — valid
  • ./scripts/verify-outcome.sh — 38 passed; outcome verified
  • local official surface audit: OpenCode 1.18.25; tagged source confirms ordered questions, optional multiple, default custom UI, and positional answer arrays

No install or deploy was performed.


Note

Medium Risk
New external OpenCode question contract and positional answer parsing affect interview correctness; delimiter-rejection logic is security-relevant for answer integrity, but scope is dev-workflow tooling rather than production auth or data stores.

Overview
Adds an OpenCode harness on top of the shared grilling frontier contract: one ordered native question call per snapshot, strict parsing of the model-facing answer string (not private metadata), delimiter checks so custom text cannot remap decisions, plus capability probing from observed tool exposure/permission/transport (with optional opencode --version for diagnostics only).

Also adds a deterministic skill bundle (grill-me → grilling) under harnesses/opencode/, sourced from dev_workflow/generated_opencode.py and kept in sync via scripts/generate_opencode_skills.py (--check for CI), including upstream MIT notice and bundle.json manifest.

Tests cover adapter serialization, multi-select, confirmation gating, malformed answers, fallback rendering, generation byte-stability, skill validation, and (when OpenCode 1.18.25 is present) isolated .opencode/skills discovery via opencode debug skill --pure.

Reviewed by Cursor Bugbot for commit 8f68355. Bugbot is set up for automated code reviews on this repo. Configure here.

Greptile Summary

The OpenCode questionnaire adapter and generated skill bundle are ready to merge. The previously reported response-boundary remapping behavior was exercised with both next-question and final-terminator collisions; both inputs were rejected before answers could be associated with a different decision. The committed bundle is current and its generated skill metadata validates successfully.

Confidence Score: 5/5

No blocking failure remains.

The exercised response parsing path rejects structural delimiter collisions without remapping answers, and no accepted P0 or P1 finding remains.

T-Rex T-Rex Logs

What T-Rex did

  • Confirmed that the before and after probe outputs reported two ambiguous structural delimiters and no remapping.
  • Verified that commands and the working directory were recorded at the top of every log and that all retained validation commands exited with code 0.
  • Affirmed that no repository source code was modified and that the standalone probe and command captures were saved as requested.
  • Cataloged and saved five artifacts documenting the delimiter-collision probe and its validation outputs for reviewer inspection.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (4): Last reviewed commit: "test: isolate OpenCode project discovery..." | Re-trigger Greptile

@kossoy

kossoy commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the OpenCode 1.18.25 runtime-interface mismatch in 0344a3b.

The adapter and generated skill now distinguish the two real layers:

  • native UI/internal metadata: ordered string[][]
  • model-facing tool result: formatted text from question.ts, projected by message-v2.ts without the metadata

The model-facing normalizer consumes the actual formatted envelope in submitted-question order, preserves comma-joined multiple selections and custom text as surfaced, and rejects Unanswered, malformed, missing, or out-of-order entries. A regression fixture explicitly passes the old {answers: ...} assumption and proves it is rejected because that metadata is unavailable to the model.

Verification after the fix:

  • OpenCode adapter/generation tests: 17 passed
  • full ./scripts/verify-outcome.sh: 39 passed
  • official quick_validate.py: both generated OpenCode skills valid
  • no install/deploy

Comment thread dev_workflow/opencode.py Resolved
Comment thread tests/test_opencode_generation.py Resolved
Comment thread tests/test_opencode_generation.py Resolved
@kossoy
kossoy merged commit 53d1f3f into main Aug 31, 2026
4 checks passed
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.

Add the OpenCode native questionnaire adapter

1 participant