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
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,20 @@ jobs:
run: python -m py_compile install.py lib/__init__.py lib/drift.py lib/installer.py lib/intake.py lib/maturity.py lib/orient.py lib/util.py lib/verify.py
- name: Run smoke tests (both installers)
run: node test/run-tests.mjs

# Coverage floor for the Node installer (c8/V8; the Python installer is
# exercised functionally by the matrix job above but not instrumented).
# Floors sit a few points under the measured numbers so environment noise
# doesn't flake the gate; raise them as coverage improves.
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Measure coverage and enforce the floor
run: >
npx --yes c8 --include "lib/**/*.mjs" --include install.mjs
--check-coverage --lines 83 --branches 73 --functions 90 --statements 83
--reporter=text node test/run-tests.mjs
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,34 @@ Format: [Keep a Changelog](https://keepachangelog.com/) · Versioning: [SemVer](
(the `github/` → `.github/` mapping already covered the Copilot assets).
- No new rules files were added for Antigravity: it already reads the tool-agnostic
`AGENTS.md` at the repo root natively.
- **Coverage-driven test-suite hardening.** The smoke suite grows from 246 to 327
checks (Node installer coverage: 78.6 % → 85.8 % lines, 66.6 % → 76.4 % branches):
- table-driven `orient` detector tests across every supported stack (Gradle both
variants, Go, Rust, Ruby, PHP, CMake, the bare-Makefile fallback and its
suppression, pip, yarn/bun/Pipenv lockfiles, Turborepo, `package.json` without
a `build` script, malformed `package.json`, empty repo, multi-stack note) plus
`--name`/`--description`/`--build`/`--test`/`--upstream` overrides and README
description-extraction edge cases (badge/HTML skipping, 160-char truncation,
fill-in fallback);
- per-ecosystem `indepth` dependency-parsing tests (pip, Poetry, Go, Cargo,
Bundler, Composer) and a real-git-repo fixture exercising the git-history
analyzer (commit/contributor/tag counts) in both runtimes;
- unit tests for `classifyAction` pinning the full re-run matrix — including the
kit-upgrade `"update"` path that end-to-end tests cannot reach — and for the
intake wizard's `detectBranch` (normal / detached HEAD / no `.git`; exported
from `lib/intake.mjs` for testing);
- `verify` edge cases (no knowledge docs → clear error; duplicate basenames →
`2 matches` note) and CLI surface checks (usage text, unknown option);
- a **Node ↔ Python parity test**: both installers must write byte-identical
orient profiles (modulo timestamp) for the same fixture, so cross-runtime
drift now fails the suite instead of shipping;
- `npm run coverage` (c8, fetched via `npx`) and a CI `coverage` job in
`test.yml` enforcing a floor (83 % lines / 73 % branches).

### Fixed
- Python `orient` recorded fork evidence with an ASCII `->` where the Node
installer writes `→`; the two now emit identical profiles (caught by the new
parity test).

## [0.1.2] — 2026-06-30

Expand Down
2 changes: 0 additions & 2 deletions ai/analysis/audit-reports/DRIFT_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@
| stale | 0 | `[verified]` row whose code changed since the verified commit |

No drift detected. The map matches the tree.

> Stale check: stale check is opt-in — re-run with --git to compare against the last verified commit (local, read-only git).
5 changes: 3 additions & 2 deletions ai/guide/MODULE_MAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
> **Index only.** Find the area here, then open the entry file directly. Don't crawl
> the tree. The directory list can be regenerated; **Responsibility** and **Stability**
> are judgement and must be audited by a human.
> Last verified: 2026-06-25 @ commit ba964e9 (drift baseline re-anchored 2026-07-02 to the
> squash-merge commit on main — the per-row human audit dates below remain the authoritative signatures)
> Last verified: 2026-06-25 @ commit 1fd11db (drift baseline re-anchored 2026-07-02: the
> human-merged PRs #5–#7 changed `/`, `templates/`, and `docs/` after the previous baseline —
> the per-row human audit dates below remain the authoritative signatures)

> Status: drafted by an `[inferred]` cold-start pass on this repo (the kit dogfooding
> itself), then audited by a human on 2026-06-25 who set each row's Stability to `ours`
Expand Down
3 changes: 2 additions & 1 deletion lib/intake.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const FAMILIARITY = [
"Not sure",
];

async function detectBranch(targetAbs) {
/** @internal exported for testing. */
export async function detectBranch(targetAbs) {
// .git/HEAD is "ref: refs/heads/<branch>" on a normal checkout. Reading it is
// file inspection, not a git command — we never shell out.
const head = await readText(path.join(targetAbs, ".git", "HEAD"));
Expand Down
2 changes: 1 addition & 1 deletion lib/orient.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def detect_fork(target, flags):
url = m.group(1)
gh = re.search(r'[:/]([^/:]+/[^/]+?)(?:\.git)?$', url)
return {"isFork": True, "upstream": gh.group(1) if gh else url,
"evidence": f'git remote "upstream" -> {url}'}
"evidence": f'git remote "upstream" {url}'}
return {"isFork": False, "upstream": None, "evidence": 'no remote named "upstream"'}


Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"setup": "node install.mjs install",
"remove": "node install.mjs uninstall",
"test": "node test/run-tests.mjs",
"deep-test": "node test/run-deep-test.mjs"
"deep-test": "node test/run-deep-test.mjs",
"coverage": "npx --yes c8 --include \"lib/**/*.mjs\" --include install.mjs --reporter=text node test/run-tests.mjs"
},
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This directory contains the testing suites for the `ai-fication-kit` repository.
|---|---|---|---|
| **`npm test`**<br>(`node test/run-tests.mjs`) | Installer Functionality | Runs cross-runtime smoke tests for the Node and Python installers against throwaway mock repositories (e.g. testing orient, install, shazam, and uninstall). | Run during active development of the installer code or stack detection modules. |
| **`npm run deep-test`**<br>(`node test/run-deep-test.mjs`) | Full Repo Health & Standards | Performs a complete audit of the repository, including running the installer smoke tests, document claim verification, structural drift detection, license header checking, and placeholder leakage detection. | Run before submitting a PR, tagging a release, or declaring a task complete. |
| **`npm run coverage`**<br>(c8 over `run-tests.mjs`) | Node Installer Coverage | Runs the smoke tests under [c8](https://github.com/bcoe/c8) (V8 coverage, fetched via `npx`; the child `install.mjs` processes are instrumented too) and prints per-module line/branch coverage for `install.mjs` and `lib/*.mjs`. CI enforces a floor in the `coverage` job of `test.yml`. | Run when adding tests or touching `lib/` to see what the suite actually exercises. |

## Details of Deep Test Verification

Expand Down
Loading
Loading