Skip to content

[merge] Step 5: Make OKF type taxonomy pluggable per mode #22

Description

@ayrtonvwf

Part of #17.

Post-merge refactor. Keeps the OKF carrier (frontmatter/index/log/--okf/--okf-check) unchanged; makes the code-specific type taxonomy per-mode. Must come after the merge, which introduces the code/personal mode axis (fork's OpenWikiCommand is only chat|init|update today).

Consumers to thread a taxonomy through:

  • src/constants.ts:274 — REPO_DOC_TYPES / REPO_DOC_TYPE_FALLBACK / getRepoDocTypeForDirectory().
  • src/agent/prompt.ts:149 — createOkfContractSection() (via createSystemPrompt(command,...)).
  • src/agent/okf.ts:326 — stampPage() (via runOkfPass/verifyOkfConformance).
  • Tests: test/prompt.test.ts:53, test/constants.test.ts:149.

Sketch: define DocTypeTaxonomy + getDocTypeForDirectory(taxonomy, dir); rename current constant to CODE_DOC_TYPES; add getTaxonomyForMode(mode); add a minimal personal taxonomy; thread it through the two seams (both already carry mode context).

Activity

  1. ayrtonvwf commented on Jul 10, 2026

    @ayrtonvwf
    OwnerAuthor

    @claude-opus /opsx:propose

  2. claude commented on Jul 10, 2026

    @claude

    Claude finished @ayrtonvwf's task in 4m 49s —— View job • claude/issue-22-20260710-1708 • Create PR ➔


    /opsx:propose — Step 5: Make OKF type taxonomy pluggable per mode

    • Gather context (read referenced files)
    • Understand the request
    • Create OpenSpec change scaffold
    • Create artifacts (proposal, design, specs, tasks)
    • Validate + commit + push

    Created OpenSpec change pluggable-okf-taxonomy at openspec/changes/pluggable-okf-taxonomy/. Validation passes (openspec validate → valid); all 4 artifacts complete.

    Artifacts

    • proposal.md — Why/What/Impact. Frames this as a post-merge refactor that keeps the OKF carrier unchanged and makes only the type taxonomy per-mode. One modified capability: okf-conformance.
    • specs/okf-conformance/spec.md — delta spec that renames the requirement "Type is inferred from directory via the repository documentation taxonomy" → "…via the mode-selected documentation taxonomy" and modifies it: code mode keeps today's exact types; personal mode gets a personal taxonomy; the prompt contract and stamping pass read the same selected taxonomy.
    • design.md — key decisions: DocTypeTaxonomy as an explicit value (not a mutable global), rename REPO_DOC_TYPES → CODE_DOC_TYPES, minimal PERSONAL_DOC_TYPES (""→Overview, sources→Source, topics→Topic, fallback Note), and getTaxonomyForMode keyed on OpenWikiOutputMode since both seams already carry it. Includes risks, migration (pure refactor, deterministic re-stamp), and two open questions.
    • tasks.md — 5 groups: define the abstraction in constants.ts, thread through the prompt seam, thread through the stamping seam (stampPage → runOkfPass @ src/agent/index.ts:243 / verifyOkfConformance @ src/cli.tsx:918), update/extend tests, and verify.

    Key finding

    The code/personal axis already exists post-merge as OpenWikiRunMode (src/cli.tsx:12), mapped to OpenWikiOutputMode via getRunModeOutputMode (src/cli.tsx:3880). Both seams already carry mode context (createSystemPrompt gets outputMode; runOkfPass is called with outputMode in scope), so no new parameter plumbing is needed beyond the taxonomy itself.

    Ready for implementation. Run /opsx:apply to start implementing.

    • Branch: claude/issue-22-20260710-1708

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions