Every ticket as the root of its provenance graph — goal, patch, approval, runs and (as the ticket-class build lands) mandate, manifestations, guarantees, journey, artifacts and children. Rendered through the <<<TicketGraphList>>> tag.
Port route agent.prompt to Go, byte-identical JSON vs rest.php [go-port:db:route:agent.prompt]
goal
Port ONE unit of congruency to Go. ONE. This ticket is deliberately SMALL: porting a whole
layer at once is what #230 corrected (~130 units exist; a layer-sized tournament fails at
that size). Do not port anything outside this unit.
UNIT KEY : go-port:db:route:agent.prompt
(the decomposer's idempotency marker — it lives in this ticket's TITLE. Do not
edit the title, or the unit will be re-filed as a duplicate.)
LAYER : db — ticket #224 (pure-Go sqlite over the SAME schema + the data-driven api_routes engine)
PHP SOURCE: the `api_routes` row named agent.prompt (in the state db)
THE PHP ORIGINAL — the contract, read from this route's `api_routes` row:
route : agent.prompt
method : GET
auth : public
params : {"agent_id":"str"}
sql : SELECT agent_id, parent, tools, status, ts, prompt FROM agents WHERE agent_id = :agent_id
It replies {route, rows} (the sql is a SELECT).
DEPENDS ON (build these first — they are their own unit tickets):
- go-port:db:helper:congruency_rest_route
THE BUILD — small, and ITERATIVE:
1. Implement ONLY this unit in the Go port.
2. Run the equivalence-diff below, PHP original vs Go port, over the SAME database.
3. If the diff is non-empty, fix the Go side and go back to 2. The PHP is the spec: when
they disagree, the Go port is wrong — never 'improve' the behaviour here. If the PHP
is genuinely defective, file a separate bug ticket and port the defect faithfully.
EQUIVALENCE-DIFF — both servers on the SAME db, byte-identical JSON:
diff <(curl -s 'http://127.0.0.1:8899/rest.php?route=agent.prompt') \
<(curl -s 'http://127.0.0.1:8900/rest.php?route=agent.prompt')
Exercise it once per declared param above (and once with each omitted — the
engine binds NULL for a param the caller did not send).
PHP encodes these with json_encode(..., JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) and echoes a trailing "\n". Byte-identical therefore also means: 4-space PRETTY_PRINT indent, "/" left unescaped, PHP's key order, PHP's number formatting, and that final newline.
THE GATE (how this ticket settles): the diff above is EMPTY. Not 'equivalent', not 'looks
right' — empty. Paste the exact diff invocation you ran and its empty output as the
evidence. Anything less is not a settled unit.
Kind is `build` (a pair: coder + adversarial tester). This unit gets a tournament only if
someone judges it genuinely worth one — that is the exception on #230, not the default.
Filed mechanically by tools/go_port_decomposer.py under ticket #230.
patch
none
approval
unapproved
runs
no runs recorded
mandate (clauses)
not yet recorded — lands with the ticket-class build
manifestations
not yet recorded — lands with the ticket-class build
guarantees
not yet recorded — lands with the ticket-class build
journey (blunders & successes)
not yet recorded — lands with the ticket-class build
artifacts (forge)
not yet recorded — lands with the ticket-class build