Skip to content

feat(cli): close the command-surface gaps around maps, goals, and artifacts - #89

Merged
FreshlyBrewedCode merged 2 commits into
mainfrom
feat/82-command-surface-gaps
Sep 13, 2026
Merged

FreshlyBrewedCode merged 2 commits into
mainfrom
feat/82-command-surface-gaps

Conversation

@FreshlyBrewedCode

Copy link
Copy Markdown
Owner

What & why

Closes #82. Closes the gaps an agent reaches for and does not find in the CLI, on both the filesystem and GitHub backends.

User-facing change

Before After
Closing a map's issue was the only archive gesture; afterwards every command said the map does not exist wayful map archive / wayful map unarchive, wayful map list --all; a map-scoped command names the archive and how to restore it
A map's allowed step types were enforced but could not be set (hand-edit only) wayful map create --allowed-step-types … and wayful map restrict set/clear it; wayful map show reports it
Artifact scope required mutating WAYFUL_MAP wayful context 'file:docs/spec.md' --map <name>
Goals had no show wayful goal show reports description, body, required outputs, and attachments
artifact show reported a ref and kind but never its content artifact show dereferences an attached markdown file: ref and prints its content; opaque refs stay opaque and unattached refs are refused
Before / after example session

Before:

$ wayful map show --map redesign
wayful: map 'redesign' does not exist.

$ wayful context file:docs/survey.md        # needed WAYFUL_MAP=redesign
wayful: map context is required; pass --map or set WAYFUL_MAP.

$ wayful artifact show file:docs/survey.md --map redesign
Ref: file:docs/survey.md
Kind: document

After:

$ wayful map archive --map redesign
Archived map 'redesign'.

$ wayful map list
(no redesign)

$ wayful map list --all
redesign (archived): Audit the auth flow

$ wayful map show --map redesign
wayful: map 'redesign' is archived; run 'wayful map unarchive --map redesign' to restore it.

$ wayful map unarchive --map redesign
Restored map 'redesign'.

$ wayful map restrict --map redesign --allowed-step-types research
Restricted map 'redesign' to types: research.

$ wayful map show --map redesign
Map redesign
Start: Audit the auth flow
Allowed step types: research
…

$ wayful context file:docs/survey.md --map redesign
Scope: artifact
Artifact: file:docs/survey.md (document)
Produced by:
- redesign/#1 survey
…

$ wayful goal show --map redesign --goal initial-goal
initial-goal: Findings recorded
Body: (empty)
Required outputs:
- evidence (artifact)
Attachments:
- none

$ wayful artifact show file:docs/survey.md --map redesign
Ref: file:docs/survey.md
Kind: document
Content:
# Survey

Findings.

How

  • MapMetadata gains a derived archived flag. Filesystem stores archived_at in map.toml; GitHub derives it from the map issue's closed state, so no fact is stored twice.
  • MapStore gains archiveMap, unarchiveMap, and setAllowedStepTypes, plus includeArchived on listMaps and allowedStepTypes on createMap. resolveMap refuses an archived map with the restore hint.
  • New commands are wired through the shared MapStore, so they behave the same under both backends; backend-specific behaviour is only how the state is represented.

Tests

  • New end-to-end CLI coverage in command-surface.test.ts (archive lifecycle, type restrictions, context --map, goal show, artifact show content).
  • MapStore contract gains archive/unarchive/restriction cases; GitHub store tests cover close/reopen, includeArchived, and body/state mutations.
  • bun check passes (CLI 335 pass / UI 49 pass).

Closes #82.

…ifacts

- `map archive` / `map unarchive`, with `map list --all`; a map-scoped
  command against an archived map names the archive and how to restore it
  instead of claiming the map does not exist.
- `map create --allowed-step-types` and `map restrict` set or clear a
  map's allowed step types; `map show` reports the current value.
- `context --map <name>` renders artifact (and step) scope without
  WAYFUL_MAP set.
- `goal show` reports a goal's description, body, required output slots,
  and current attachments.
- `artifact show` dereferences an attached markdown `file:` ref and prints
  its content, keeping opaque refs opaque and refusing unattached refs.

Both filesystem and GitHub backends implement the new MapStore
operations: filesystem stamps `archived_at` in `map.toml`; GitHub closes
and reopens the map issue and carries the restriction in the issue body.
@FreshlyBrewedCode
FreshlyBrewedCode merged commit 3ec50ec into main Sep 13, 2026
2 checks passed
@FreshlyBrewedCode
FreshlyBrewedCode deleted the feat/82-command-surface-gaps branch September 13, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): close the GitHub backend's command-surface gaps

1 participant