Skip to content

feat: add wright lint package commands - #861

Merged
Teakowa merged 1 commit into
mainfrom
feat/lint-package-commands
Oct 20, 2026
Merged

Teakowa merged 1 commit into
mainfrom
feat/lint-package-commands

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements wright lint package <search|install|list|outdated|update|remove> (parent #616), stacked on #857 (feat/lint-package-store, the #842 store/fetch layer — this PR's diff is the second commit only; GitHub will retarget to main once the base merges).

  • search [QUERY] — paged GitHub repository search on topic:wrightkit-lint archived:false fork:false (10-page/1000-result cap); QUERY narrows further. Explicit-URL install needs no topic.
  • install SOURCE [--ref REF] — owner/repo, github.com URL spellings (/tree/, /releases/tag/, .git, git@), or owner/repo@<ref>; conflicting ref spellings are a usage error. Fetches into the store only — never activates.
  • list — every store entry (intact with rule IDs, damaged with its refusal reason) in stable owner/repo/sha order.
  • outdated — read-only: each entry's installed SHA vs the repository's current default-branch head → unchanged/updated/unavailable/error. Since only the SHA is stored (Support GitHub-based community lint rule discovery and lifecycle management #616 decision), head is the comparison point. Damaged entries report error and are never checked.
  • update [SOURCE] — for an updated entry, installs the resolved head as a new immutable <sha>/ entry (the previous entry — including any locally edited managed files — is never touched). One SOURCE restricts the set; everything else is untouched.
  • remove SOURCE — deletes the managed rules/ tree, then the entry dir only when nothing else remains: user-owned files beside rules/ survive (pruned status); empty <owner>/<repo> parents are pruned.
  • Results flow through the shared wright-result/v1 envelope (ADR-0030): row-level failures become a gated FAIL with per-package lint-package-* diagnostics; command-level failures map to the documented exit codes (lint-package-source→2, lint-package-invalid→1, remote/store→4). The three read-only commands join the query-verdict list (PACKAGE-SEARCH/PACKAGE-LIST/PACKAGE-OUTDATED in place of a vacuous PASS).
  • lint keeps its finding workflow; args_conflicts_with_subcommands + subcommand_precedence_over_arg make lint --fix package … a usage error.
  • docs/cli/commands.md, lint.md, machine-contract.md, presentation.md updated.

Test plan

  • 14 CLI tests (lint_package.rs + lint_package_lifecycle.rs) spawn the real wright binary against a recorded-response HTTP server — env-redirected store and endpoints, no real network
  • 8 driver tests for entries/remove/search (enumerate intact+damaged, prune semantics, user-file preservation, paging/terms/error classes)
  • Every subcommand covered for success/unchanged/updated/unavailable/error; outdated verified not to mutate the store; update <source> touches only that repo; remove/update preserve user files and refuse damaged entries
  • cargo fmt, cargo clippy --workspace --all-targets --all-features -D warnings, cargo test --workspace --all-targets --all-features — all green locally

Fixes #844

@Teakowa
Teakowa force-pushed the feat/lint-package-store branch from 6aa7216 to 0d4aca6 Compare October 20, 2026 10:53
@Teakowa
Teakowa force-pushed the feat/lint-package-commands branch from 0f4c207 to 82a4aaf Compare October 20, 2026 10:56
Base automatically changed from feat/lint-package-store to main October 20, 2026 13:37
@e54-bot
e54-bot force-pushed the feat/lint-package-commands branch 2 times, most recently from 22b354e to 6e4b458 Compare October 20, 2026 14:02
@Teakowa
Teakowa enabled auto-merge (squash) October 20, 2026 14:13
Add the six 'lint package' subcommands — search, install, list,
outdated, update, remove — over the #842 GitHub package store. Rows go
through the shared wright-result/v1 envelope (ADR-0030): query commands
use command-name verdicts, lifecycle commands gate FAIL with
per-package diagnostics, and plain/terminal/JSON render from one
LintPackageResult.

Store entries stay immutable and keyed by full commit SHA; installing
never activates a package or touches project configuration. Remove
deletes only Wright-managed rules, preserving unrelated files as
'pruned' rows. The package runner and its renderer impls live in
lint-owned modules so the shared presentation files keep their shape.

Closes #844
@e54-bot
e54-bot force-pushed the feat/lint-package-commands branch from 6e4b458 to e033f1e Compare October 20, 2026 14:15
@Teakowa
Teakowa merged commit 328eb80 into main Oct 20, 2026
35 checks passed
@Teakowa
Teakowa deleted the feat/lint-package-commands branch October 20, 2026 14:20
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Make Workshop Great Again Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

wright lint package: search, install, list, outdated, update, remove

2 participants