Skip to content

OpenAI-default Attest ticket dispatcher - #92

Merged
sykosyber merged 7 commits into
mainfrom
feat/kane-factory-dispatch
Oct 26, 2026
Merged

sykosyber merged 7 commits into
mainfrom
feat/kane-factory-dispatch

Conversation

@reason-machines

@reason-machines reason-machines Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Class: R
Agent-platform: Reason
Admitted-by: self (Class R)
Objective: Deliver the Attest ticket dispatcher from SyberWork #90 with OpenAI as the default worker.

Change

  • Added examples/attest_dispatch.py to validate attest.ticket/v0, emit the receipt-bridge-compatible unverified observation on stderr, and print only validated Git-format diff output on stdout.
  • The default workers.example.json worker is the OpenAI Responses API (gpt-5-mini); command workers remain an explicit --worker command opt-in for CI/development without a key.
  • OpenAI prompting now requires the smallest change and explicitly forbids changing seed data, existing rows or names, unrelated behavior, or adding data that makes the spec pass by itself. Structured output contains complete content only for changed files; SyberWork builds the diff locally.
  • OpenAI worker configuration supports optional service_tier and reasoning.effort, passed through to the Responses API (for example, priority and medium).
  • Command-worker CRLF output is normalized, and final diff bytes bypass Windows text-mode newline conversion.
  • Added the requested README usage, configuration documentation, and offline command-worker/configuration tests.

Usage

ATTEST_WORKER_CMD="python <abs path>/examples/attest_dispatch.py" attest prove demo/spec.md --app demo/app --loop

To opt into the offline command fixture directly, use python examples/attest_dispatch.py --worker command. The included fixture emits a blank-line demonstration patch; replace it with a real harness for useful changes.

Checks

  • PYTHONPATH=. python3 -m unittest discover -s tests -p 'test_attest_dispatch_example.py' -v — passed (10 tests).
  • PYTHONPATH=. python3 -m unittest discover -s tests -q — passed (577 tests, 25 skipped).
  • PYTHONPATH=. python3 -m conformance.run — passed (23 golden traces).
  • python3 -m py_compile examples/attest_dispatch.py tests/test_attest_dispatch_example.py — passed.
  • git diff --check — passed.

Live verification and CI

The prior live CRM exercise on bc02525 exposed seed-data padding, as reported in the PR discussion. This commit adds the anti-padding instruction; a live CRM rerun on ffab30f has not yet been performed. CI has started on the new head and is pending.

Fixes #90

Open in Reason

Contributors

reason-machines Bot and others added 3 commits October 24, 2026 22:50
Co-authored-by: sykosyber <132870419+sykosyber@users.noreply.github.com>
Co-authored-by: sykosyber <132870419+sykosyber@users.noreply.github.com>
Fixes #90

Co-authored-by: sykosyber <132870419+sykosyber@users.noreply.github.com>
@reason-machines
reason-machines Bot changed the base branch from feat/kane-factory-receipt-bridge to main October 24, 2026 23:39
reason-machines Bot and others added 3 commits October 24, 2026 23:40
Default the example configuration to an offline command worker while keeping OpenAI selectable. Ask OpenAI for complete structured file contents and generate unified diffs locally.

Co-authored-by: sykosyber <132870419+sykosyber@users.noreply.github.com>
Select the OpenAI Responses worker by default and keep the command worker available only via --worker command. Normalize CRLF command output and write the final patch as UTF-8 bytes to keep Windows diffs intact.

Co-authored-by: sykosyber <132870419+sykosyber@users.noreply.github.com>
@reason-machines reason-machines Bot changed the title Add offline-first Attest ticket dispatcher OpenAI-first Attest ticket dispatcher Oct 25, 2026
@sykosyber

Copy link
Copy Markdown
Member

Tested #92 against a real ticket from today's live Acme CRM run (0ca486124ac8-c05-40), worker config {"type": "openai", "model": "gpt-6-sol"}:

  • Admission, observation on stderr, structured whole-file output and the locally built diff with diff --git headers all work; the diff applies with git apply --recount in Attest's candidate copy. Good.
  • Blocking issue: the model padded seed data. Its patch added { name: "Globex renewal", ... } to the app's starting deals list, which makes the spec's step pass without implementing "Mark as won". Attest's built-in worker hit the same thing earlier and fixed it with this rule in the instructions; please add it to the OpenAI worker's instructions in examples/attest_dispatch.py:

    Implement the capability with the smallest change, in the existing code style, markup and CSS conventions. Do not change seed data, existing rows, names or unrelated behaviour, and do not add data that makes the spec pass by itself: the user performs the spec's steps in the browser. Return the complete new content of each file you change (only those files).

  • Contract fix on Attest's side: Attest tickets carried an extra expects key that is not in attest.ticket/v0 (Forget a thread under an explicit retention rule #11); your strict check rejected it, correctly. Attest now omits it (commit on its event-day branch shortly).
  • Please also allow "service_tier" and "reasoning": {"effort": ...} in the openai worker config (Attest runs gpt-6-sol with service_tier: "priority" and medium effort).

When the instruction change is in, comment the commit and Attest will run the CRM spec through dispatch live (ATTEST_WORKER_CMD="python .../examples/attest_dispatch.py --workers <config>").

Co-authored-by: sykosyber <132870419+sykosyber@users.noreply.github.com>
@reason-machines

Copy link
Copy Markdown
Contributor Author

Pushed ffab30f to the existing draft: the OpenAI instruction now prohibits seed-data/row/name changes and adding data that makes the spec pass independently; config accepts and forwards service_tier and reasoning.effort. Focused tests: 10 passed; full suite: 577 passed, 25 skipped; conformance: 23 traces matched; compilation and git diff --check passed. The live CRM ticket has not been rerun on this head; ready for Captain/Attest to retry.

@reason-machines reason-machines Bot changed the title OpenAI-first Attest ticket dispatcher OpenAI-default Attest ticket dispatcher Oct 25, 2026
@sykosyber

Copy link
Copy Markdown
Member

Verified with Attest: with attest#22 (worker model no longer parsed from the inherited ATTEST_WORKER_CMD), the full factory loop ran end to end through this dispatcher on Windows: Acme CRM spec, line 15 broken (no Mark as won), ticket admitted by attest_dispatch, routed to the command worker (python -m attest.worker, gpt-6-sol), Kane re-check 4/4 proven, receipt 0ca486124ac8-c05-46. The four real tickets from Oct 24 also return a diff through this head (ffab30f) in 7 to 10 s each. Ready to merge from the Attest side.

@sykosyber
sykosyber marked this pull request as ready for review October 26, 2026 07:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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-26T07:44:16.993089Z ffab30f Draft marked ready
ℹ️ 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.

@sykosyber
sykosyber merged commit e2e6408 into main Oct 26, 2026
12 checks passed

@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: ffab30fc13

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

"+++ ",
"@@",
" ",
"+",

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 Validate hunk syntax before accepting worker output

When a command worker emits file headers followed by +new without a hunk header, this prefix check accepts it and the dispatcher exits successfully. I confirmed git apply --check rejects that output as “patch with only garbage,” so the caller receives an invalid diff instead of a worker failure. Validate the hunk structure before forwarding the patch.

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.

Kane Factory: dispatch worker CLI for attest.ticket/v0 (Claude Code leads)

1 participant