# surface-shape — exploration The shape of the command surface: which verbs exist, what they take, what they print, and how an item is addressed. Status semantics are settled in `status-model`; this topic is about the ergonomics built on top of them. coupled-with: `topic:json-output` ## Findings - Query filtering now has two spellings available at once: a status verb (`wk file ready`) and a flag on a general list verb (`wk file ls --status ready`). Keeping both means two code paths and two vocabularies to document. - The four verbs are groups, so the verb form cannot express an ungrouped state such as `abandoned`. Some general filter must exist regardless. - Items come in three id shapes already: a filename stem (`TASK-fix-parser`), a slug (specs), and a qualified pair for standalone exploration files. Stems are long, so an exact-match-only id is tedious to type but immune to ambiguity. - The motivating questions are "what is ready" and "what is done", asked with no flags at all. - A path is what a caller usually needs next, both for `show` and for scripting. - The repo already answers "where do I put machine-readable output" with `--json` on the `devtree` CLI. - A status-grouped listing puts folder layout out of reach: which folder an item sits in is reachable only through `show` or the item's `dir` and `subpath` fields, never from the listing read first. - Folder layout is project convention, not a fixed taxonomy: tasks and handoffs sit at root or under a `tasks/`-style folder, a spec item owns a whole directory, a standalone brief sits where it was drafted. The folder set is discovered, never enumerated. - Status grouping is load-bearing in two places: the human rendering's headed sections and the `--filter` grouping model. Every listing shares one item object, and `json-output` is frozen, so a default change reaches into it or deliberately stops short. - Every table already carries a real status column, so a folder-grouped rendering loses no state information — only the headings change meaning. - `ls` is the one verb whose name promises a flat directory listing, yet it was the verb that grouped; grouping sat behind a name that says nothing about grouping. `git status` versus `git ls-files` is the precedent: the grouped human view and the flat listing are separate verbs, and the flat one is the one scripts and `grep`-style habits expect. - The walk is project-wide and cwd-independent: "invoking it from any depth inside that tree finds the same root". Scoping a listing to the cwd subtree is a filter over the same discovered items, so it is cheap — but it retires that invariant for listings, and the id portability rule ("an id means the same item from any directory") has to be decided separately so `do` and `show` keep working from a subdirectory. ## Design crux Two ways to express the same filter — a verb per group and a flag on a listing — either both exist, and the surface has to justify the redundancy, or one is removed and the ungrouped tail needs its own home. Everything else here (columns, sorting, id syntax) follows from that choice. The answer keeps both, with the verbs as sugar over the grouped view, so the real question becomes which verb owns the grouping. ## Candidate directions None open. ## Decisions ### (settled) `filter-replaces-status` — `--filter` replaces `--status` related-to: `filter-replaces-base` & `query-vocabulary` It takes a comma-separated list, and output is presented in groups of statuses rather than one flat list. ### (settled) `ls-shows-everything-in-scope` — A bare `wkf ls` shows every item in scope related-to: `listing-scope-cwd` & `archived-is-a-location` In scope means the invocation directory and below, or the project with `--all`. Ungrouped tails are included; only the archived items under `.ARCHIVED/` are missing, and those are reached by an explicit `archived` token. ### (settled) `typed-ids` — Ids are typed everywhere `task:`, `handoff:`, `idea:`, `bug:`, `spec:`, `spec::explo`, and `explo:` for a brief that lives outside any spec directory. The grammar is `:[:]`, which makes cross-family collisions structurally impossible. ### (settled) `id-name-drops-prefix-and-date` — The name part drops the filename prefix and the date token related-to: `typed-ids` A task file `TASK-foo.md` has the id `task:foo`, and so does the legacy `TASK-20261001T1110-foo.md`. The kind token carries the type, and the date is metadata about the file rather than identity. The date segment is optional in a name, because the timestamp lives in the file's frontmatter; when both are present the block wins. ### (settled) `slug-uniqueness` — Slug uniqueness is a corpus invariant related-to: `typed-ids` & `duplicate-slug-is-error` Within one kind, no two items share a slug anywhere in the project, so an id needs no directory part and means the same thing from any directory. `wkf` cannot enforce the invariant at the source — it never creates files — so a duplicate is reported as an error naming both paths and repaired by a rename by hand. No qualified `[kind]:[dir]/[slug]` form exists. ### (settled) `brief-id-in-spec-space` — A brief inside a spec directory belongs to the spec id space related-to: `typed-ids` & `brief-suppresses-topics` It is `spec::explo`, while a standalone brief uses the `explo:` kind, so the same artefact is addressed consistently with where it lives. ### (settled) `filter-replaces-base` — `--filter` replaces the base selection of the verb it is given to related-to: `filter-replaces-status` & `ls-positional-token` A `+` prefix adds to that base instead. `status` starts from the live groups — `draft`, `ready`, `claimed` — while `ls` starts from every non-archived item, so a bare `ls` shows finished and retired work too. On `ls`, `+` is meaningful for `archived` alone, every other token being already included. ### (settled) `grouped-sections-keep-status-column` — Headings and the status column both name the group related-to: `two-grouping-axes` A section heading names the group, and every row still carries the raw `STATUS` tag, so the heading says what the rows have in common while the table says which tag put each row there. ### (settled) `show-is-a-router` — `show` is a router, never a reader It prints id, kind, raw status, derived groups, and the joined location (`/tooling/SPEC-DRAFT-wk-files/SPEC.md`), plus the parts present for a spec (`discovery`, `spec`, `explo`). Artefact content is never printed, so the tool owes no truncation policy and never reflows markdown it did not author. The field is plural because a brief matches two groups at once, and the status is absent for a file that carries no tag, so neither can be a single mandatory word. ### (settled) `ls-has-no-path-flag` — `ls` has no `--path` flag Paths belong to `show`, so `ls` keeps a single rendering and the "where is it" question has exactly one answer. ### (settled) `separate-wkf-binary` — File-backed management ships as a separate binary, `wkf` The tool is called `wk-files`. `wk` stays a pure beads passthrough, so its "`init` is the single deliberate exception" rule survives untouched and no local namespace has to be checked against future `bd` subcommands. ### (settled) `mutations-under-do` — Every mutation lives under `wkf do ` related-to: `status-verbs-are-queries` `wkf do claim`, `wkf do finish`, `wkf do abandon`, `wkf do undo`, `wkf do reset`, `wkf do archive`. Queries stay top-level, so the grammar itself says whether a command can write, and a future mutation joins the action set without changing the top-level surface. ### (settled) `path-wherever-id` — Every verb accepts a filesystem path wherever it accepts an id coupled-with: `resolution-probes-filesystem` The input forms are interchangeable, so a path just seen in a listing can be passed straight to `show` or an action verb. ### (settled) `resolution-probes-filesystem` — Resolution probes the filesystem rather than parsing the syntax related-to: `path-inside-walk` coupled-with: `path-wherever-id` An existing path inside the walk is the item; otherwise the argument is matched as an id; an argument that is neither is refused as unknown. Ids and paths share no marker a parser could trust, so the lookup decides instead. ### (settled) `path-inside-walk` — A path must resolve inside the walk coupled-with: `walk-rules` The walk defines the item set, so a path outside it is not an item the tool knows and is refused. ### (settled) `filter-and-type-compose` — Both listing verbs carry `--filter` and `--type` coupled-with: `elsewhere-follows-selection` `--type spec --filter ready` answers "specs awaiting work", which neither axis can express alone. ### (settled) `two-grouping-axes` — Listings group on two axes, and a flag picks the outer one related-to: `status-vs-ls-split` & `group-order` `--by-dir` is the default: directory headings, status sections inside. `--by-status` flips it: status headings, directory sections inside. The flags are alternatives, not composable, and the inner axis is always the other one. Both levels always print, so a section holding a single group is never collapsed. Each heading names its axis — `Dir: