Skip to content

Add a methodology-only llm endpoint (phases 1–2 without the XLSForm spec) #28

Description

@jstet

formulaid (the survey generator, CorrelAid/formulaid) wants this site's survey methodology (phases 1–2) without the XLSForm specification. For question types it already ships the registry-generated cdl-survey-types reference from formtransform, which is authoritative, and the general spec in its context contradicts it.

Today scripts/build_skill.sh in formulaid fetches https://umfragen.civic-data.de/llm-phases12-xlsform.txt (LLM_METHODOLOGY_URL, line 26). It then deletes everything between the headings # XLSForm-Dokumentation and # Fragen formulieren (lines 185–192), and checks for Fragen formulieren again at line 268. That breaks silently if those headings change. A dedicated endpoint removes the guesswork.

Steps

  1. Add src/pages/llm-phases12.txt.ts, the same wrapper as the existing llm-*.txt.ts files, calling buildLlmTxt('none', 2): phases 1–2 without XLSForm examples and without the xlsform-standard page.
  2. buildLlmTxt / getSlugsForPhases (src/lib/utils/llm-txt.ts, lines 247 and 232) need a way to leave a page out of text output. toc.json already marks xlsform-standard in excludeFromGraphic for the Fragebogendesign section (line 25). Add an equivalent text exclusion (e.g. excludeFromText), or have the 'none' format skip it. Don't reuse excludeFromGraphic for this; the two may diverge.
  3. Keep every existing endpoint working and unchanged. Other consumers may rely on them.
  4. Once it's live, open an issue on CorrelAid/formulaid: switch LLM_METHODOLOGY_URL to /llm-phases12.txt and drop the heading strip. Link it here.

Acceptance criteria

  • curl localhost:4321/llm-phases12.txt (under bun run dev) contains the Datenschutz and Operationalisierung sections and no # XLSForm-Dokumentation heading
  • llm-phases12-xlsform.txt, llm-xlsform.txt, llm.txt, llm-ddi.txt are byte-identical before/after (diff the built files)
  • formulaid issue filed and linked
  • bun run build passes

Until formulaid has switched, don't rename # XLSForm-Dokumentation or # Fragen formulieren.

Rules (apply to all site changes around formtransform)

  • Don't restate the supported XLSForm subset in prose. Link to it: https://github.com/CorrelAid/formtransform#supported-xlsform-subset. A hand-copied type list on the site becomes a third source of truth, after the registry and the generated skill.

  • Don't rename or delete these snippet paths. Three apps fetch them at build time through the GitHub API, and each falls back to an empty string, so a rename doesn't fail a build. It silently empties a section of the app:

    App Fetches
    formtransform-app src/content/snippets/formtransform/{en,de}.html, liability/{en,de}.html
    qwac qwac/{en,de}.html, liability/{en,de}.html
    formulaid formulaid/{en,de}.html, liability/{en,de}.html
  • Headings in the llm*.txt endpoints are an interface. formulaid's scripts/build_skill.sh fetches llm-phases12-xlsform.txt and slices it by the headings # XLSForm-Dokumentation and # Fragen formulieren. Don't change them without telling CorrelAid/formulaid.

  • German is primary; EN/DE snippets stay in sync. The apps render whichever locale the visitor has.

  • Registry facts belong to CorrelAid/formtransform. If the site needs a machine-readable list of supported types, open an issue there. Don't copy JSON into the site.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions