SpecsCLISettings Reconfiguration
Implementation Notes
Implementation Notes
Summary
- Implemented
hi ensure, the shared init/ensure selector, backlog project URL persistence, URL-authoritativewrite-backlog, generated-surface sync, and operator documentation.
Execution Mode
- sequential
Surprises and Decisions
- The plan's direct
bun testcommand bypassed the repository Vitest configuration; evidence uses the equivalent package test script. writeRepoSettingsgained an explicit no-stamp mode so settings reconfiguration preserves known version fields while scaffold/update retain their existing managed stamping behavior.- Harness
.devpunks/settings.jsonuseshttps://linear.app/devpunks/project/harness-intelligence-5780e6830f87, the HARNESS-INTELLIGENCE project URL already recorded inapps/wiki/content/docs/project/grilling/harness-public-entrypoints-backlog.md; this avoids inventing a destination. - A closeout bundled-update smoke initially repinned manifest authority to the worktree/bundled version. The generated manifest was restored exactly to the committed remote-stable authority (
2026.07.13-codex-multi-agent-config) and canonical Desktop paths; settings retained the same baseline/CLI pins plus only the new URL. - Stage tests now supply backlog URLs explicitly. The shared test prompt has no global URL fallback, so missing init prompt answers fail instead of being masked.
Sanity Checks
| Check | Result | Notes |
|---|---|---|
| T1 focused tests | Pass | Review correction included; command coverage is 5 tests, including repeated canonical-settings byte idempotency. |
| T2 scaffold/update tests | Pass | Review correction included; invalid init URL guidance now points to hi scaffold init. |
| T3 content/consumer tests | Pass | 2 files, 38 tests; upstream/bundle byte match. |
| Final focused suite | Pass | 7 files, 111 tests. |
Bare hi command guide | Pass | Autoreview RED reproduced in brand test; guide now lists settings-only hi ensure, distinguishes tool repair, and describes init as repository-settings selection. |
| CLI typecheck and build | Pass | tsc --noEmit; 1032 modules bundled. |
| Built help | Pass | Root lists ensure; settings and tool commands have distinct descriptions. |
| Built fixture smoke | Pass | URL trimmed; sentinel hash unchanged; only settings mutated. |
| Built remote-stable update check | Expected feature drift | write-backlog and settings changed; 0 stale files, no baseline drift; manifest authority unchanged. |
| Generated skill alignment | Pass | Upstream, CLI bundle, Harness .agents, and scaffolded consumer aligned. |
| Focused production lint | Pass | New selector and command modules clean. |
| Repository-wide CLI check | Existing debt | Broad check reports pre-existing lint violations across legacy/generated CLI files; focused touched production lint is clean. |
| Diff whitespace check | Pass | git diff --check. |
Review
- Standards and Spec axis reviewers initially found manager-tool preservation, init retry guidance, and idempotency-evidence gaps; each was fixed with focused regression coverage and both axes re-reviewed clean.
- Structured review command:
.agents/skills/autoreview/scripts/autoreview --mode local --model gpt-5.5 --prompt "Final re-review of the settings-reconfiguration feature after root command-guide fix. Governing spec: apps/wiki/content/docs/project/specs/cli/settings-reconfiguration/SPEC.md. Report only actionable defects; ignore unrelated legacy lint debt." - Final structured result:
autoreview clean: no accepted/actionable findings reported(patch is correct, confidence0.78).
Acceptance Criteria Status
| Criterion | Status | Notes |
|---|---|---|
| 1 | Met | Four settings are selected; URL trimming and absolute HTTP(S) validation covered. |
| 2 | Met | Init and ensure call selectRepoSettings; wiki selection remains init-only. |
| 3 | Met | Command test and built fixture prove settings-only mutation. |
| 4 | Met | Defaults/idempotency and missing-settings guidance covered. |
| 5 | Met | Manager-tool transition, preservation, de-duplication, and sorting covered. |
| 6 | Met | Legacy settings without URL are readable and upgradeable. |
| 7 | Met | Init, setup, check, and update preservation tests pass. |
| 8 | Met | write-backlog requires settings authority and stops with hi ensure guidance. |
| 9 | Met | Upstream commit add6bb4 pushed; bundle, Harness generated skill, and consumer align. |
| 10 | Met | Help, root docs, runbook, routed wiki flow, and changelog updated. |
Manual Review Checklist
| Area | Check | How to perform | Expected result |
|---|---|---|---|
| CLI | Reconfigure settings only | Run node apps/cli/dist/index.js ensure in an initialized fixture, accept provider defaults, and enter a URL with surrounding spaces. | Only .devpunks/settings.json changes and the stored URL is trimmed. |
| Migration | Upgrade legacy settings | Remove backlogProjectUrl, run built ensure, and enter an absolute HTTP(S) URL. | Legacy settings load and the URL is added. |
| Validation | Reject invalid destination | Run built ensure and enter an empty, relative, or non-HTTP URL. | Command stops with absolute HTTP(S) guidance and points to hi ensure. |
| Help | Distinguish ensure commands | Run built --help, ensure --help, and tools ensure --help. | Top-level ensure is settings-only; nested command installs/repairs tools. |
| Backlog | Confirm destination authority | Read a scaffolded .agents/skills/write-backlog/SKILL.md. | Settings are read before provider work; discovery/guessing is forbidden. |