cli: add hm commands, expert shell, and Nix entrypoints #54

Open
nsaspy wants to merge 17 commits from feat/hm-cli-entrypoints into master
Owner

What changed

  • add public hm command dispatch for:
    • hm scan TARGET [NMAP-ARG ...]
    • hm recon DOMAIN
    • hm inventory import FILE [auto|domain|host|url]
    • hm expert
  • add dedicated hm-expert executable / nix run ...#expert
  • expose the same scan, recon, and inventory import implementations inside Lish
  • persist command-mode observations/assets into the current workspace operation store
  • replace the dev-shell-only flake with a stable public Nix interface on x86_64-linux and aarch64-linux
  • pin Hackmode's Yew/Lish snapshot, Tek9, and StarIntel Common Lisp schema for reproducible builds
  • refresh the old 2023 nixpkgs lock to the same current nixpkgs revision used by Tek9
  • add nix flake check coverage for the public output contract, Lish compile/load, CLI help, expert entrypoint packaging, and inventory import
  • add a pinned Nix CI lane

Public flake contract

packages.<system>.default
packages.<system>.hm
packages.<system>.expert
apps.<system>.default
apps.<system>.hm
apps.<system>.expert
checks.<system>.*
devShells.<system>.default

Internal Common Lisp dependency derivations remain private implementation details instead of leaking into packages.

Public usage

nix flake show github:lost-rob0t/hackmode
nix build github:lost-rob0t/hackmode
nix build github:lost-rob0t/hackmode#hm
nix build github:lost-rob0t/hackmode#expert
nix run github:lost-rob0t/hackmode -- --help
nix run github:lost-rob0t/hackmode#hm -- --help
nix run github:lost-rob0t/hackmode#expert

Inside the expert shell:

scan 192.168.1.0/24
recon starintel.actor
inventory import inventory.txt

The Lish commands are intentionally thin adapters over the same Common Lisp command functions used by hm; there is no parallel implementation to drift.

## What changed - add public `hm` command dispatch for: - `hm scan TARGET [NMAP-ARG ...]` - `hm recon DOMAIN` - `hm inventory import FILE [auto|domain|host|url]` - `hm expert` - add dedicated `hm-expert` executable / `nix run ...#expert` - expose the same `scan`, `recon`, and `inventory import` implementations inside Lish - persist command-mode observations/assets into the current workspace operation store - replace the dev-shell-only flake with a stable public Nix interface on x86_64-linux and aarch64-linux - pin Hackmode's Yew/Lish snapshot, Tek9, and StarIntel Common Lisp schema for reproducible builds - refresh the old 2023 nixpkgs lock to the same current nixpkgs revision used by Tek9 - add `nix flake check` coverage for the public output contract, Lish compile/load, CLI help, expert entrypoint packaging, and inventory import - add a pinned Nix CI lane ## Public flake contract ```text packages.<system>.default packages.<system>.hm packages.<system>.expert apps.<system>.default apps.<system>.hm apps.<system>.expert checks.<system>.* devShells.<system>.default ``` Internal Common Lisp dependency derivations remain private implementation details instead of leaking into `packages`. ## Public usage ```sh nix flake show github:lost-rob0t/hackmode nix build github:lost-rob0t/hackmode nix build github:lost-rob0t/hackmode#hm nix build github:lost-rob0t/hackmode#expert nix run github:lost-rob0t/hackmode -- --help nix run github:lost-rob0t/hackmode#hm -- --help nix run github:lost-rob0t/hackmode#expert ``` Inside the expert shell: ```text scan 192.168.1.0/24 recon starintel.actor inventory import inventory.txt ``` The Lish commands are intentionally thin adapters over the same Common Lisp command functions used by `hm`; there is no parallel implementation to drift.
nix: use current swi-prolog package name
Some checks failed
nix / nix-flake-check (pull_request) Failing after 9s
agent-pr-serialization / one-open-pr-per-agent-lane (pull_request_target) Failing after 2s
agent-framework-boundary / keep-agent-framework-out-of-product-tree (pull_request) Successful in 12s
core / common-lisp-core (pull_request) Failing after 2m17s
monorepo / hygiene (pull_request) Successful in 4m45s
9a7e2c35a1
nix: keep nixpkgs input identity lock-stable
Some checks failed
nix / nix-flake-check (pull_request) Failing after 5s
agent-framework-boundary / keep-agent-framework-out-of-product-tree (pull_request) Successful in 5s
core / common-lisp-core (pull_request) Failing after 36s
monorepo / hygiene (pull_request) Has been cancelled
8bc2da6e30
nix: package nhooks as an explicit ASDF dependency
Some checks failed
agent-framework-boundary / keep-agent-framework-out-of-product-tree (pull_request) Successful in 4s
nix / nix-flake-check (pull_request) Failing after 3s
core / common-lisp-core (pull_request) Failing after 37s
monorepo / hygiene (pull_request) Has been cancelled
77eb574c75
nix: wire explicit Sento derivation
Some checks failed
agent-framework-boundary / keep-agent-framework-out-of-product-tree (pull_request) Successful in 4s
nix / nix-flake-check (pull_request) Failing after 4s
core / common-lisp-core (pull_request) Failing after 26s
monorepo / hygiene (pull_request) Successful in 15m9s
9e4d67cb6f
Author
Owner

Operator clarification: Nix flake outputs are a first-class deliverable, not incidental packaging.

Before this PR is considered complete, the public flake surface should be clean and intentional under nix flake show, with at least:

  • packages.<system>.default -> installable Hackmode bundle
  • packages.<system>.hm -> CLI package
  • packages.<system>.expert (or a similarly clean public attr) -> expert-shell package
  • apps.<system>.default -> hm
  • apps.<system>.hm -> hm
  • apps.<system>.expert -> hm-expert
  • checks.<system>.* -> executable load/smoke checks, including LISH and CLI paths
  • devShells.<system>.default -> working Hackmode development shell

Prefer stable public attr names over exposing internal build-system names such as hmExpert unless there is a concrete reason.

Exact-head acceptance must exercise the outputs, not only enumerate them:

nix flake show
nix build .#hm
nix build .#expert
nix run . -- --help
nix run .#expert
nix flake check
nix develop -c hm --help

If .#expert is modeled only as an app rather than a package, use the corresponding package attr for the build proof, but the public run surface must remain nix run .#expert.

Do not add a NixOS module/overlay just for completeness unless Hackmode actually needs one. Keep the first output surface small, executable, and stable.

Operator clarification: **Nix flake outputs are a first-class deliverable**, not incidental packaging. Before this PR is considered complete, the public flake surface should be clean and intentional under `nix flake show`, with at least: - `packages.<system>.default` -> installable Hackmode bundle - `packages.<system>.hm` -> CLI package - `packages.<system>.expert` (or a similarly clean public attr) -> expert-shell package - `apps.<system>.default` -> `hm` - `apps.<system>.hm` -> `hm` - `apps.<system>.expert` -> `hm-expert` - `checks.<system>.*` -> executable load/smoke checks, including LISH and CLI paths - `devShells.<system>.default` -> working Hackmode development shell Prefer stable public attr names over exposing internal build-system names such as `hmExpert` unless there is a concrete reason. Exact-head acceptance must exercise the outputs, not only enumerate them: ```sh nix flake show nix build .#hm nix build .#expert nix run . -- --help nix run .#expert nix flake check nix develop -c hm --help ``` If `.#expert` is modeled only as an app rather than a package, use the corresponding package attr for the build proof, but the public run surface must remain `nix run .#expert`. Do not add a NixOS module/overlay just for completeness unless Hackmode actually needs one. Keep the first output surface small, executable, and stable.
Some checks failed
agent-framework-boundary / keep-agent-framework-out-of-product-tree (pull_request) Successful in 4s
nix / nix-flake-check (pull_request) Failing after 4s
core / common-lisp-core (pull_request) Failing after 26s
monorepo / hygiene (pull_request) Successful in 15m9s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/hm-cli-entrypoints:feat/hm-cli-entrypoints
git switch feat/hm-cli-entrypoints

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff feat/hm-cli-entrypoints
git switch feat/hm-cli-entrypoints
git rebase master
git switch master
git merge --ff-only feat/hm-cli-entrypoints
git switch feat/hm-cli-entrypoints
git rebase master
git switch master
git merge --no-ff feat/hm-cli-entrypoints
git switch master
git merge --squash feat/hm-cli-entrypoints
git switch master
git merge --ff-only feat/hm-cli-entrypoints
git switch master
git merge feat/hm-cli-entrypoints
git push origin master
Sign in to join this conversation.
No description provided.