Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- `nshell/weave`: a cl-weave regression suite covering the completion engine.
It exercises the cl-prolog knowledge base with property-based tests, fixtures,
and benchmarks; runs direct Prolog queries (`findall`, negation-as-failure,
and a Lisp foreign predicate composed with domain facts); and uses the
`cl-prolog/weave` `deftest-queries`/`assert-query` bridge. Runnable via
`scripts/weave.lisp`, the `weave` dev-shell alias, and the `weave` Nix check.
- `nshell.domain.completion:completion-rulebase` now publicly compiles the
completion knowledge base into a first-class `cl-prolog:rulebase`, and the
completion logic predicates (`completes`, `describes`, `has-flag`,
`command-is`, `suggests-dir`, `suggests-file`) are exported so the rulebase
answers the full cl-prolog query API.
- Vi-mode char-wise visual selection (`v`) with motion, yank, delete, change,
and count-aware editing coverage.
- Parameter expansion now covers substring slicing (`${VAR:offset[:length]}`)
Expand All @@ -16,12 +27,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
command lookups so repeated completion requests stay responsive.

### Fixed
- `%autosuggest-closed-quoted-token-p` no longer reports a lone quote character
(`end - start = 1`) as a closed quoted token — a latent bug surfaced by a
test that a stray missing paren had kept from ever running under FiveAM.
- Prompt command-duration tracking now records a non-negative millisecond value,
including sub-millisecond commands.
- `source` command substitution scanning now preserves literal
non-substitution `$` characters.

### Changed
- Migrated the entire test suite from FiveAM to
[cl-weave](https://github.com/takeokunn/cl-weave). All ~1,290 cases now use
`describe`/`it`/`expect`; the FiveAM dependency is removed from the ASDF
system, the Nix flake, and the dev shell. Pass/fail parity with the previous
FiveAM run was verified case by case.
- README and man page claims now align with the current 0.4.x status, test-count
evidence, vi visual selection, here-document, and here-string support.
- README testing and contribution guidance now distinguishes hermetic Nix checks
Expand Down
11 changes: 9 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ reproducible toolchain is [Nix](https://nixos.org/download) with flakes enabled.
```sh
git clone https://github.com/takeokunn/nshell
cd nshell
nix develop # SBCL + FiveAM dev shell
nix develop # SBCL + cl-weave dev shell
nix build # build ./result/bin/nshell
nix flake check --print-build-logs
```
Expand Down Expand Up @@ -41,7 +41,7 @@ Please keep dependencies pointing inward:
## Making changes

1. **Branch** off `main`.
2. **Add tests.** Every behavior change should come with FiveAM tests under
2. **Add tests.** Every behavior change should come with cl-weave tests under
`tests/` (unit, integration, property-based, or e2e as appropriate). Prefer
testing pure domain logic directly.
3. **Keep tests hermetic.** Tests must not depend on the ambient working
Expand Down Expand Up @@ -75,6 +75,13 @@ For coverage-oriented validation, run:
nix develop -c sbcl --script scripts/coverage.lisp
```

For completion-engine or cl-prolog knowledge-base changes, also run the
cl-weave suite (property-based, fixture, benchmark, and Prolog-query coverage):

```sh
sbcl --script scripts/weave.lisp # or the `weave` alias in nix develop
```

For parser, expansion, execution, or builtin changes, include focused unit tests
and at least one integration or REPL/source test when behavior crosses layer
boundaries. For terminal, job-control, or process changes, state which operating
Expand Down
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ git clone https://github.com/takeokunn/nshell
cd nshell
nix build # produces ./result/bin/nshell
nix flake check --print-build-logs
nix develop # dev shell with SBCL + FiveAM
nix develop # dev shell with SBCL + cl-weave
```

Inside `nix develop`, you can load the system into a REPL:
Expand Down Expand Up @@ -139,10 +139,18 @@ unit-testable without a terminal.

## Testing

The suite uses [FiveAM](https://github.com/lispci/fiveam) and is exposed through
Nix checks.
nshell runs entirely on [cl-weave](https://github.com/takeokunn/cl-weave), with
two complementary suites exposed through Nix checks:

Run the same hermetic Linux/macOS gate used by CI:
- **`nshell/test`** — the primary regression suite (~1,290 cases,
`describe`/`it`/`expect`).
- **`nshell/weave`** — a focused suite that exercises the completion engine's
[cl-prolog](https://github.com/takeokunn/cl-prolog) knowledge base with
property-based tests, fixtures, benchmarks, and direct Prolog queries
(`findall`, negation-as-failure, foreign predicates) plus the
`cl-prolog/weave` query bridge.

Run the same hermetic Linux/macOS gate used by CI (it runs both suites):

```sh
nix flake check --print-build-logs
Expand Down Expand Up @@ -175,6 +183,14 @@ nix develop -c sbcl --script scripts/coverage.lisp
The report is written to `coverage/cover-index.html` by default. Set
`NSHELL_COVERAGE_DIR` to redirect the output.

Run the cl-weave suite on its own (the `weave` alias in `nix develop`, or
directly). The runner self-registers sibling `../cl-weave` and `../cl-prolog`
checkouts, so no extra environment setup is needed:

```sh
sbcl --script scripts/weave.lisp
```

Unit, integration, property-based, and end-to-end tests live under `tests/`.
New shell-language, expansion, completion, job-control, and input-state changes
should include focused regression tests plus the relevant property or PTY
Expand Down
205 changes: 205 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading