Repository source: docs/plans/quill_ports/quill_ports_one_shot.md
Quill in Perl and PHP
Cycle: v3/quill_ports; Mode: one-shot; Record/index: this file, plans index
Debug mode: enabled (project marker .railspike_debug_on)
Effort study: railspike-effort, protocol P2, reference R1; host ledger. Standing P2 enrollment. Follows quill_rename, which filed this work as a follow-up; no parent cycle.
Extended estimates: disabled (one approach; the two ports are not alternatives and are not staged)
Cycle estimate: 0.75 (execution entry; intake 0.60)
Status: implemented and verified locally; PR open, awaiting maintainer review, merge and deploy. Production check pending.
Original request
Maintainer, 2026-11-22: "do we have multiple versions o quill yet?" (answer: no, only public/quill.py). Then: "can you please write pl and php versions? for perl, please use pollyanna as style guide".
Authorization
Maintainer, 2026-11-22, the request above. It asks for the two ports to be written; with AGENTS.md (every committed change runs as Railspike, one-shot by default) it authorizes a one-shot cycle through an open PR. It does not cover merging, deploying or production access.
Feedback item
PF-20261116-F04, "PHP and Perl versions of Quill", filed by quill_rename. Its note: each version should send its own User-Agent so the update notice can tell them apart.
Outcome and work type
Application change. Quill becomes a multi-language set:
public/quill.plandpublic/quill.phpdo whatpublic/quill.pydoes, with the same commands, options, output lines, saved-operation files and exit codes (0, 1 missing, 2 error, 3 staged):index,read,check,thread,reply(signed and prepared protocols,--resume,--replace,--image, trouble reports),pending,approve,checkin,caught-up.All three share the state directory (
~/.local/state/quill, or~/.local/state/frmwhen only that exists) and its file formats, so a key made by one version posts from another, and an operation saved by one can be resumed by another.The site serves
/quill.pland/quill.phpbeside/quill.py.Each version sends its own User-Agent (
quill/…,quill-pl/…,quill-php/…), and the update notice compares a copy against the file of the same language and names that file.The Perl version follows Pollyanna's Perl style (
doc/style.txtanddefault/template/perl/in gulkily/pollyanna): tab indents, CamelCase subs declared assub Name { # $arguments ; description, oneshiftper argument,} # Name()closers,WriteLogtracing, sanity-check regexes on paths and IDs. The PHP version follows this repository's PHP scripts (scripts/publish_text.php).
Exclusions:
No Pillow equivalent. Without Pillow,
quill.pysends an already-prepared PNG or JPEG with its metadata removed; the ports do the same and nothing more (no resizing or format conversion). Their messages point toquill.pywith Pillow for that.No new dependencies. Perl uses core modules, curl and gpg. PHP needs no extension beyond core; the
intlextension is optional (see risks).No change to
quill.pybehavior or version.
Approach and risks
Port quill.py function by function, keeping its names recognizable in each language, then run the existing HTTP tests against all three.
High: the shared state directory. A port that writes
identity.txtoroperation.txtdifferently could break the Python client's resumes or keys. Validation: a parity test writes with one version and resumes or reuses with another. Mitigation: sameKey: valuefiles, same names, same site-hash subdirectory.Unicode normalization in PHP.
quill.pysigns NFC text. PHP'sNormalizerneedsintl, which shared hosts may lack. Mitigation: withoutintl, a non-ASCII draft goes through the prepared route, where the server composes the canonical bytes and the client signs them exactly (the routequill.pyalready uses on older servers). ASCII drafts need no normalization.--replaceneeds the signed route, so withoutintla non-ASCII fix says so. Perl hasUnicode::Normalizein core.Perl on Windows. Running a process with separate output and error capture uses
fork. The ports are for Unix-like hosts, the same hosts wherequill.pyexpects curl and gpg.Taint mode. Pollyanna runs Perl with
-T. A client invoked asperl quill.plfrom any directory, finding curl and gpg on the caller'sPATH, would have to overridePATHto run under taint mode. The port keeps Pollyanna's sanity-check style without-T.A PHP file in the web root.
public/.htaccessandpublic/router.phpsend every request toindex.php, so/quill.phpis never executed by supported hosts. The file also refuses to run outside the CLI.
Reuse decisions
public/quill.pyis the reference; nothing in it is reimplemented differently on purpose.src/ForumRewrite/Http/ClientDownload.php: extendPATHS,FILE-by-path and the version reader to cover the three files, instead of a second download handler.tests/QuillClientTest.php: itsrun()already takes the interpreter as an argument. Extend the HTTP tests to loop over the three versions (the parity rule inmulti_language_scripts.md) rather than writing a separate suite.Process and encoding idioms come from
scripts/publish_text.plandscripts/publish_text.php(list-form processes, curl with--disable, byte-level form escaping).
Completion conditions
Normal entry: an agent on a host with Perl or PHP and no Python downloads
/quill.plor/quill.phpfrom the site and posts.End to end: each version publishes a signed thread and reply, resumes a lost response without a duplicate, reports a staged post and replaces it, approves a key, and shows the check-in, against a local test server.
Recovery: a write interrupted in one version resumes in it; a key made by
quill.pysigns from the ports.External: after deploy,
/quill.pland/quill.phpon zenmemes.com serve the files, and a post made with each shows up as theclaudeidentity. Pending until the maintainer deploys.Release: PR merged and deployed.
Concepts touched
Agent posting client: changed (three versions, per-language update notice).
Verification and recovery plan
Run
QuillClientTestover all three interpreters, plusquill_client_test.py,LlmsTxtRendererTestand the smoke set. Full suite not run (AGENTS.md).perl -c public/quill.pl,php -l public/quill.php.A cross-version test: key from Python, post from Perl and PHP under the same identity.
A live read-only check against zenmemes.com (
index,read,check) from each version.Search the docs for places that list the client and add the siblings:
multi_language_scripts.md,agent_api.md, the concept entry,llms.txtrenderer.git diff --checkand a diff review.
Starting revisions and branch
Starting revision cc6680c9 (main). Branch feat/quill-ports.
Planning commit
d4f5ec3c (record and plans index only). It carries a Feedback: PF-20261116-F04 trailer without updating the item; the item is updated in the completion commit, which also carries the trailer.
Study history
2026-11-22: intake 0.60, rated after listing the files and their sizes and reading the feedback item, before reading
quill.py. Single exposed Claude rater (the same session wrote the earlier Python-side posts). Baselinecc6680c9.2026-11-22: execution entry 0.75, revised up after reading
quill.py(1,179 lines, nine commands, two protocols, image handling) andQuillClientTest.php: two full ports plus parity tests is more than the intake assumed. Scope unchanged.2026-11-22: retrospective 0.75. Scope unchanged; three additions inside it (the no-
intlfallback test, the CLI-only guard test, the cross-version test). No split. Maintainer fit judgment pending; no accepted-count change.
Dated execution history
2026-11-22: record written. Mode one-shot: the scope is fixed by the existing client, and no approach choice needs the maintainer.
2026-11-22, implementation:
public/quill.pl: port ofquill.pyin Pollyanna's Perl style (80 subs, eachsub Name { # $arguments ; descriptionwith a} # Name()closer, oneshiftper argument, tab indents,WriteLoglines shown withQUILL_DEBUG=1). Core modules only (Digest::SHA,Encode,JSON::PP,Unicode::Normalize,File::Temp,File::Path,Time::Local,POSIX). Processes run byforkandexecwith stderr to a temporary file; no shell. Function names followquill.py's (request→Request,new_post→NewPost), so a search finds the same step in each version. Decision: no taint mode (see risks).public/quill.php: port in this repository's PHP script style (scripts/publish_text.php). PHP 8.1+ core only;intloptional. Refuses to run outside the CLI. Correction during work: a helper namedurlEncodecollided with the built-inurlencode(PHP function names ignore case); renamedformEncode.Both send their own User-Agent (
quill-pl/2026-11-22,quill-php/2026-11-22), printUpdate:once per run, write the sameidentity.txt,operation.txt,key.txtand payload files, and printperl quill.pl …orphp quill.php …inResume:,Check:andReplace:lines.Image messages name the fix that applies to them ("Export a smaller copy, or use quill.py with Pillow…") instead of
quill.py's "Install Pillow". Everything else prints the same lines.ClientDownload:PATHSmaps each download path to its file;AGENTSmaps each User-Agent product to the file it is compared with;currentVersion()reads the version line of any of the three files./frm.pystill servesquill.py.Docs:
llms.txt(one line naming the siblings; the update-notice line no longer names/quill.pyonly),agent_api.md(quickstart paragraph, version section, members-only discovery list),multi_language_scripts.md(new set row and the two documented differences), the concept entry,README.md.Tests:
QuillClientTestloops 15 of its HTTP tests over the three versions (self::each) and fails with the version's name. The pending-keys test importsquill.pyas a Python module, so it stays Python-only. New:testServedPhpClientIsNeverExecuted,testVersionsShareKeysAndResumeEachOthersOperations(a key fromquill.pyposts from the others under one identity; a lost write saved by each version is resumed by another with no new commit),testPhpWithoutIntlStillPostsUnicode(runsphp -n, which dropsintlhere).testUpdateNoticeComparesVersionscovers each language's version line.
2026-11-22, verification:
./v3 test --smoke QuillClientTest LlmsTxtRendererTest PlatformDocsPageTest AgentApiWorkedExampleTest WebServerRoutingTest: 539 run, 539 passed.QuillClientTestalone: 20 passed in 80 s (17 in 28 s before). Full suite not run.python3 tests/quill_client_test.py: 40 passed (quill.pyunchanged).Mutation check: breaking the success output of
quill.pl, then ofquill.php, failedtestFirstWriteReuseAndLegacyFallbackwith "quill.pl: …" and "quill.php: …". A busy-retry test did not notice the Perl break, since it checks exit codes only; the broader tests did.perl -candphp -l: clean. Argument errors, bad--site, bad--retriesand missing--body-file: same messages and exit code 2 in all three (argparse's own usage line differs from the ports' "Use --help for usage.").Live, read-only, against zenmemes.com from each port:
index,read,check(found and missing),checkin. No posts were made there../v3 feedback check: 0 problems. No test failed on the base commit.Pending: after deploy, fetch
/quill.pland/quill.phpfrom zenmemes.com and post once with each.
Outcome
Delivered as authorized. Limits, all documented: the ports cannot resize or convert images (no Pillow); quill.php without intl uses the prepared protocol for non-ASCII drafts and cannot --replace them; both need a Unix-like host. The Perl port does not run in taint mode.
Final review
Diff checked for duplication (one download handler, one test suite looping over versions), scope (no change to quill.py) and docs. The concept entry is updated. The completion commit carries the implementation, this record, the ledger file, the debug log and the feedback item.
Commit/merge/publication status
Completion commit: pending at the time of writing; its hash goes in the PR description. Not merged or deployed.
— Claude · 2026-11-22 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)