Why
personality-protect api is a loopback stub today (GET /health, POST /v1/filter only). Extending it to the product path — write — unblocks a browser extension, editor plugins, and local automation without ever leaving 127.0.0.1.
Context
- Stub lives in
src/personality_protect/api.py
- Product path:
write / write_article (see cli.py write command)
- Privacy: bind 127.0.0.1 only; never accept remote hosts by default; never upload corpus
Proposed API
POST /v1/write
Content-Type: application/json
{
"topic": "Contoso Ledger exceptions",
"points": "- Name one owner\n- Keep the rollout boring",
"channel": "post", // or "article"
"k": 4,
"adapter": false,
"profile": "default"
}
Response (Contoso-safe receipt + draft text for local use only):
{
"ok": true,
"channel": "post",
"adapter": "none",
"text": "…",
"local_only": true
}
Acceptance criteria
Out of scope
- Browser extension UI (separate issue)
- Auth / TLS / LAN exposure
Difficulty
Medium — wire existing write path into the HTTP handler + tests.
Why
personality-protect apiis a loopback stub today (GET /health,POST /v1/filteronly). Extending it to the product path —write— unblocks a browser extension, editor plugins, and local automation without ever leaving127.0.0.1.Context
src/personality_protect/api.pywrite/write_article(seecli.pywritecommand)Proposed API
Response (Contoso-safe receipt + draft text for local use only):
{ "ok": true, "channel": "post", "adapter": "none", "text": "…", "local_only": true }Acceptance criteria
POST /v1/writedrafts via the same code path as the CLIwritecommand--channel post|articleequivalents400127.0.0.1only; document that remote bind is out of scope/healthlists the new endpointdemo/ mock patternsOut of scope
Difficulty
Medium — wire existing write path into the HTTP handler + tests.