codegen: never expose user data to the cloud codegen endpoint

Codegen is the primarily-cloud model, so it must receive only a de-identified,
reusable spec. The trusted local `llm` now authors a `goal` (plus a generic
service/transport) with every user-specific value stripped, and that is the only
task data any codegen prompt ever carries.

- skills: SkillDraft carries `goal` (not `requirements`); generate_skill ->
  generate_skill_spec; the spec prompt/parser ask for a de-identified goal +
  generic service/transport; registry persists `goal`, never request_text.
- codegen: every prompt builder (body, retry, regen, testgen) drops the
  Request/requirements parameters and builds from the spec alone; the whole
  elicitation surface is removed.
- scheduler: the codegen worker runs body -> fidelity -> contract -> test only;
  repair and fidelity evidence bundles are de-identified (failure_kind +
  integration + goal + previous body); approval gate moved to
  codegen.approval.wait_timeout; the question queue is now the repair ask_user
  path only.
- config: drop the codegen.elicitation block; add codegen.approval.
- docs/assets: update AGENTS.md, CODEGEN.md, README.md, docs/flow.md,
  bootstrap comment, static app.js; regenerate docs/flow-authoring.svg.
- tests: add tests/test_codegen_privacy.py (structural + behavioural sentinel
  checks, de-identified repair evidence, registry goal); update/remove the rest.

Purged (no migration): data/decisions.jsonl, data/runs.jsonl, data/categories.json.
This commit is contained in:
gabby committed 2026-10-11 00:52:30 +00:00
1 parent def51f81dc
commit 1833932f1c
19 files changed
+561 -907

No files matched your search

+7 -3
View File
@@ -18,7 +18,7 @@ from semif_agent.skills import (
build_skills,
build_tree,
generate_category,
generate_skill,
generate_skill_spec,
)
@@ -106,11 +106,13 @@ def test_generate_category_via_provider():
def test_generate_skill_via_provider():
httpd, base = _fake_server(
'{"title": "track.live", "description": "Follow a package in real time."}'
'{"title": "track.live", "description": "Follow a package in real time.", '
'"goal": "poll a parcel tracking endpoint and report status", '
'"service": "tracking", "transport": "http"}'
)
try:
client = LLMClient(base_url=base, model="test", timeout=10)
draft = generate_skill(
draft = generate_skill_spec(
client,
Request("track my drone delivery"),
"tracking",
@@ -118,6 +120,8 @@ def test_generate_skill_via_provider():
)
assert isinstance(draft, SkillDraft)
assert draft.name == "track.live"
assert draft.goal == "poll a parcel tracking endpoint and report status"
assert draft.integration == {"service": "tracking", "transport": "http"}
finally:
httpd.shutdown()
httpd.server_close()