Skip to content

Hold the request line's keys to a contract, and the skill to the line - #848

Merged
jeremy merged 4 commits into
mainfrom
connect-request-contract
Oct 7, 2026
Merged

jeremy merged 4 commits into
mainfrom
connect-request-contract

Conversation

@jeremy

@jeremy jeremy commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Stacked on #843 (base connect-role), because the contract includes #843's role key. It retargets to main once #843 merges.

Why

basecamp connect supersedes the local agent connector, so its "type":"request" line is the contract that the basecamp-connect skill, and any session or practice driving the connector, keys on. Until now nothing held it:

  • A renamed tag passed every test. The handoff tests decode the line into the same struct that wrote it.
  • The skill's example could drift silently. The example in skills/basecamp-connect/SKILL.md that teaches the reader the field names could drift from the real line with nothing noticing.

This is the small part worth keeping from "one format for both connectors". We don't need a shared driver. We do need a written contract for the connector that stays.

What changes

  • requestLineContract names every key the line must carry, with nested keys written as parent.child. A renamed or dropped key fails TestTheRequestLineKeepsItsContract. Adding a key is allowed.
  • TestTheSkillDocumentsTheRequestLineItGets holds the skill's example to the line's keys exactly. A key added to the line has to be documented where readers learn it.
  • HandoffLine's doc comment says so.

Tests

These tests pin current behaviour, so they pass on creation. I checked they catch drift by mutating:

  • renaming requester_id's tag fails the contract test;
  • removing role from the skill example fails the skill test;
  • adding an undocumented field to the line fails the skill test.

make check passes on linux.


Summary by cubic

Pins the keys of the "type":"request" handoff line to a contract, and holds the basecamp-connect skill's example to those exact keys. The contract covers every key the line can carry: optional fields are flushed by reflection so a key hidden behind omitempty can't slip past, nested keys are compared as full dotted paths, and a zero-valued line keeps every required key. The line's keys must equal the contract in both directions, so renaming, dropping, or adding a key fails tests, and the skill has to document any change, where before a renamed tag passed tests and the skill's example could drift silently.

Written for commit b5b21a9. Summary will update on new commits.

Review in cubic Turn on auto-fix

@jeremy
jeremy requested a review from a team as a code owner October 6, 2026 05:27
Copilot AI balanced review requested due to automatic review settings October 6, 2026 05:27
@jeremy

jeremy commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@github-actions github-actions Bot added the tests Tests (unit and e2e) label Oct 6, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T04:17:40.147319Z b5b21a9 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread internal/connector/handoff.go
Comment thread internal/connector/request_contract_test.go Outdated

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

Copy link
Copy Markdown

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: d697b4a57d

ℹ️ 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 thread internal/connector/request_contract_test.go Outdated
@jeremy

jeremy commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@jeremy

jeremy commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

@jeremy
jeremy requested a balanced review from Copilot October 6, 2026 05:44
@cubic-dev-ai

cubic-dev-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@jeremy I have started the AI code review. It will take a few minutes to complete.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 451dec7599

ℹ️ 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".

@jeremy

jeremy commented Oct 6, 2026 •

Copy link
Copy Markdown
Member Author

Review state at head afe9f62

Fixed after review:

  • The line's keys must equal the contract, both ways.
  • A zero-valued line must keep every key except the two optional ones (recording.project_name, requester_name), so a required key that gains omitempty fails.
  • The fixture is filled by reflection, and keys are walked at any depth.

I checked each by mutation: renaming a tag, an undocumented key, and omitempty on acknowledge each fail.

Later fixes: the skill example is found under CRLF line endings, and an empty object counts as a key. Both were raised by Codex and cubic, with a test that fails without them.

@jeremy
jeremy force-pushed the connect-request-contract branch from 451dec7 to e09a4e8 Compare October 6, 2026 19:49

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

Copy link
Copy Markdown

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: e09a4e88c5

ℹ️ 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 thread internal/connector/request_contract_test.go
@jeremy

jeremy commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@jeremy

jeremy commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

@jeremy
jeremy requested a balanced review from Copilot October 6, 2026 19:54
@cubic-dev-ai

cubic-dev-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@jeremy I have started the AI code review. It will take a few minutes to complete.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Copy link
Copy Markdown

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: e09a4e88c5

ℹ️ 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 thread internal/connector/request_contract_test.go Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Turn on auto-fix | Re-trigger cubic

@jeremy
jeremy force-pushed the connect-request-contract branch from e09a4e8 to d6bdf05 Compare October 6, 2026 20:08

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Turn on auto-fix | Re-trigger cubic

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: afe9f62cff

ℹ️ 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".

@jeremy
jeremy force-pushed the connect-request-contract branch from afe9f62 to a440615 Compare October 6, 2026 23:38

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

Copy link
Copy Markdown

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: a440615d68

ℹ️ 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 thread internal/connector/request_contract_test.go
Comment thread internal/connector/request_contract_test.go
@jeremy

jeremy commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@jeremy

jeremy commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

@jeremy
jeremy requested a balanced review from Copilot October 6, 2026 23:42
@cubic-dev-ai

cubic-dev-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@jeremy I have started the AI code review. It will take a few minutes to complete.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Turn on auto-fix | Re-trigger cubic

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: a440615d68

ℹ️ 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".

Base automatically changed from connect-role to main October 7, 2026 03:48
jeremy added 4 commits October 6, 2026 20:52
The request line is read by programs nothing in this repo runs: the
basecamp-connect skill, and the session or practice driving the
connector. Its keys are what those readers match on. A renamed json tag
passed every test, because the tests decode the line into the same
struct that wrote it, and the skill's example of the line could drift
from the real one with nothing noticing.

Pin the names the line must carry, and hold the skill's example to the
line's keys exactly, so a renamed or dropped key fails here, and a key
added to the line has to be documented where the reader learns it.
The fixture set only the two optional fields that exist today, so a key
added later with omitempty stayed out of the comparison, and keys were
read one level deep. Fill every field by reflection, and walk nested
objects to their full dotted path.
…o values

A key added to the line had to reach the skill but not the contract,
and a required key that gained omitempty vanished from real lines at
its zero value while the filled fixture still showed it. The line's
keys now equal the contract's, and a zero-valued line keeps every key
but the two documented as optional.
Copilot AI balanced review requested due to automatic review settings October 7, 2026 04:05
@jeremy
jeremy force-pushed the connect-request-contract branch from a440615 to b5b21a9 Compare October 7, 2026 04:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jeremy

jeremy commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@jeremy

jeremy commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@jeremy I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Turn on auto-fix | Re-trigger cubic

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: b5b21a9e3a

ℹ️ 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".

@jeremy

jeremy commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

Rebased onto main (943dbb5). connect-role had landed as #843, so only this PR's own four commits were replayed, with git rebase --onto origin/main 164bb786. Nothing conflicted. #840 renamed the plugin, but the skill this test reads, skills/basecamp-connect/SKILL.md, kept its path, and its example still matches the request line's keys after #843 and #847. The fmt, vet, lint, test and tidy gates passed on linux before the push, and CI is green on b5b21a9.

Review threads: 0 open (all 10 were already resolved). Codex reported on b5b21a9 with no major issues, and cubic found no issues. Copilot can't review because the requester's quota is exhausted.

@jeremy
jeremy merged commit 9454de9 into main Oct 7, 2026
30 of 31 checks passed
@jeremy
jeremy deleted the connect-request-contract branch October 7, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants