@anhcodo13/lattice 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,23 +1,23 @@
1
1
  # NKLattice
2
2
 
3
- NKLattice is an independent, local CLI for project governance and architecture analysis across Next.js, Vite + React, and React applications. Version 0.3.0 assesses exact app coverage, dependency policy and source architecture in standalone repositories or npm/pnpm workspaces.
3
+ NKLattice is an independent, local CLI for project governance and architecture analysis across Next.js, Vite + React, and React applications. Version 0.4.0 assesses exact app coverage, dependency policy, architecture, known dependency advisories, code quality, code security and browser/mobile-emulation compatibility in standalone repositories and npm/pnpm workspaces. Its compatibility gate records tested browser versions and mobile user-agent OS versions, then compares them with the central test-environment floors; physical-device support remains outside this scan.
4
4
 
5
- **Tiếng Việt:** NKLattice đánh giá danh sách app, dependency và kiến trúc mã nguồn theo policy chung cho các ứng dụng Next.js, Vite và React. Xem [tài liệu tiếng Việt](https://khuchieunghi.github.io/nklattice/vi/docs/introduction/).
5
+ **Tiếng Việt:** NKLattice đánh giá danh sách app, dependency, kiến trúc, chất lượng và bảo mật mã cùng tính tương thích trình duyệt theo policy chung cho Next.js, Vite và React. Xem [tài liệu tiếng Việt](https://khuchieunghi.github.io/nklattice/vi/docs/introduction/).
6
6
 
7
- ## Run the 0.3.0 source release
7
+ ## Install and run 0.4.0
8
8
 
9
- Requires Node.js 24 or newer. The npm package is `@anhcodo13/lattice` and the executable is `lattice`. Version 0.3.0 is awaiting npm account approval; the published 0.2.0 release supports dependency governance only. From this checkout, run:
9
+ Requires Node.js 24 or newer. The npm package is `@anhcodo13/lattice` and the executable is `lattice`. Install the exact version, commit the package manifest and lockfile, and create the `.nklattice-apps.json` inventory described in the [governance guide](https://khuchieunghi.github.io/nklattice/docs/governance/). The full assessment also needs the listed scanner and test tools in the consuming repository.
10
10
 
11
11
  ```sh
12
- pnpm install --frozen-lockfile
13
- pnpm build
14
- npm exec --package . -- lattice governance assess examples/governance \
15
- --policy governance/policy.json --expect-apps 3
12
+ npm install --save-dev --save-exact @anhcodo13/lattice@0.4.0
13
+ npx lattice --version
14
+ npx lattice governance run . --policy path/to/reviewed-policy.json \
15
+ --expect-apps 1 --evidence /tmp/lattice-governance-evidence.json
16
16
  ```
17
17
 
18
- After npm approval and publication, install with `npm install --global @anhcodo13/lattice@0.3.0` and run `lattice governance assess path/to/app --expect-apps 1`. Check `npm view @anhcodo13/lattice version` before installing. Each app needs a committed `.nklattice-apps.json` for the assessment.
18
+ The command writes `.nklattice-governance/assessment.json` and an offline HTML report. Use `npm view @anhcodo13/lattice version` to verify what the public registry currently serves before installing.
19
19
 
20
- ## Verify the source and try the published 0.2.0 CLI
20
+ ## Verify the source and try the published CLI
21
21
 
22
22
  The source checkout uses pnpm 10.30.3:
23
23
 
@@ -25,9 +25,9 @@ The source checkout uses pnpm 10.30.3:
25
25
  corepack enable
26
26
  pnpm install --frozen-lockfile
27
27
  pnpm verify
28
- pnpm dlx @anhcodo13/lattice@0.2.0 doctor examples/governance/apps/vite
29
- pnpm dlx @anhcodo13/lattice@0.2.0 analyze examples/governance/apps/vite
30
- pnpm dlx @anhcodo13/lattice@0.2.0 governance check examples/governance \
28
+ pnpm dlx @anhcodo13/lattice@0.4.0 doctor examples/governance/apps/vite
29
+ pnpm dlx @anhcodo13/lattice@0.4.0 analyze examples/governance/apps/vite
30
+ pnpm dlx @anhcodo13/lattice@0.4.0 governance check examples/governance \
31
31
  --workspace-root examples/governance \
32
32
  --policy governance/policy.json --expect-apps 3
33
33
  ```
@@ -36,25 +36,19 @@ pnpm dlx @anhcodo13/lattice@0.2.0 governance check examples/governance \
36
36
 
37
37
  The analysis writes `report.html` and `analysis.json` into the app's `.nklattice-report/` directory. The HTML opens offline.
38
38
 
39
- ## Assess project governance from source
40
-
41
- Commit `.nklattice-apps.json` in each consumer scan root with exact app paths/profiles. The centrally reviewed policy sets dependency floors and architecture gates; app-local `.nklattice.json` cannot weaken an assessment. Build this checkout and run:
39
+ ## Assess project governance
42
40
 
43
- ```sh
44
- pnpm install --frozen-lockfile
45
- pnpm build
46
- npm exec --package . -- lattice governance assess examples/governance --policy governance/policy.json --expect-apps 3
47
- ```
41
+ Commit `.nklattice-apps.json` in each consumer scan root with exact app paths/profiles. The centrally reviewed policy sets dependency, architecture, quality, security and compatibility gates; app-local `.nklattice.json` cannot weaken an assessment. Run the combined collector and assessment shown above. The separate `collect` and `assess` commands remain useful for local inspection; the CI gate uses `run` so no editable evidence file is read between collection and verdict.
48
42
 
49
- The command evaluates inventory, dependencies and architecture per app and writes `.nklattice-governance/assessment.json` plus offline `report.html`. Exit 0 means pass, 7 measured policy failure and 3 incomplete evidence or command error. See the [project governance guide](https://khuchieunghi.github.io/nklattice/docs/governance/) for the inventory schema, scope and limits.
43
+ The command evaluates seven domains per app and writes `.nklattice-governance/assessment.json` plus offline `report.html`. Exit 0 means pass, 7 measured policy failure and 3 incomplete evidence or command error. See the [project governance guide](https://khuchieunghi.github.io/nklattice/docs/governance/) for scanner setup, inventory schema, scope and limits.
50
44
 
51
45
  ## Architecture analysis
52
46
 
53
47
  NKLattice scans supported JS/TS and JSX/TSX files, resolves local imports, builds a module graph, and reports cycles, dependency concentration, long chains, duplicate imports, unused internal exports, component size, JSX depth, and approximate complexity. Define boundary policies and adjust thresholds or score weights in `.nklattice.json`.
54
48
 
55
49
  ```sh
56
- pnpm dlx @anhcodo13/lattice@0.2.0 init path/to/app
57
- pnpm dlx @anhcodo13/lattice@0.2.0 analyze path/to/app --output path/to/report
50
+ pnpm dlx @anhcodo13/lattice@0.4.0 init path/to/app
51
+ pnpm dlx @anhcodo13/lattice@0.4.0 analyze path/to/app --output path/to/report
58
52
  ```
59
53
 
60
54
  The score is an explainable review aid, not a claim about runtime speed or correctness. See [findings](https://khuchieunghi.github.io/nklattice/docs/findings/) and [scoring](https://khuchieunghi.github.io/nklattice/docs/scoring/).
@@ -63,7 +57,7 @@ The score is an explainable review aid, not a claim about runtime speed or corre
63
57
 
64
58
  The versioned [central policy](governance/policy.json) sets minimum versions (`>=X.Y.Z`). For each supported app, the CLI checks that its direct `package.json` range cannot install below the minimum, that the npm/pnpm lockfile specifier matches the declaration, and that the resolved version satisfies both. Exact declarations are allowed when they meet the minimum. It returns exit `7` on drift and exit `3` for invalid input. Findings list the required range, declared range, lockfile specifier, locked version, and reason. A minimum has no upper bound: review framework compatibility and security separately before adopting newer major releases.
65
59
 
66
- CLI 0.2.0 requires policy schema 2. Existing schema 1 files use exact-version rules and need migration; consumers pinned to an older core SHA or npm package keep their existing behavior until explicitly upgraded.
60
+ CLI 0.4.0 requires policy schema 2. Existing schema 1 files use exact-version rules and need migration; consumers pinned to an older core SHA or npm package keep their existing behavior until explicitly upgraded.
67
61
 
68
62
  Profiles are `next`, `vite-react`, and `react`. NKLattice can infer them from direct dependencies or read an explicit app profile:
69
63
 
@@ -71,11 +65,11 @@ Profiles are `next`, `vite-react`, and `react`. NKLattice can infer them from di
71
65
  { "nklattice": { "profile": "next" } }
72
66
  ```
73
67
 
74
- The [reusable governance workflow](.github/workflows/governance-check.yml) requires a reviewed 40-character `core-ref`, an exact inventory and an `expected-apps` count. It builds CLI and policy from that commit, assesses three domains and uploads evidence. The [consumer workflow template](examples/consumer-workflow.yml) pins both the workflow `uses` ref and `core-ref` to the same SHA, with deployment depending on governance. The consumer must keep the two refs equal. For a pnpm monorepo subtree, pass its root as `--workspace-root` when running the CLI directly.
68
+ The [reusable governance workflow](.github/workflows/governance-check.yml) requires a reviewed 40-character `core-ref`, an exact inventory and an `expected-apps` count. It builds CLI and policy from that commit, installs the scanner toolchain, collects evidence and gates seven domains. The [consumer workflow template](examples/consumer-workflow.yml) pins both the workflow `uses` ref and `core-ref` to the same SHA, with deployment depending on governance. The consumer must keep the two refs equal. For a pnpm monorepo subtree, pass its root as `--workspace-root` when running the CLI directly.
75
69
 
76
70
  ```sh
77
- pnpm dlx @anhcodo13/lattice@0.2.0 governance check ./my-app --policy ./governance/policy.json
78
- pnpm dlx @anhcodo13/lattice@0.2.0 governance check ./monorepo/apps \
71
+ pnpm dlx @anhcodo13/lattice@0.4.0 governance check ./my-app --policy ./governance/policy.json
72
+ pnpm dlx @anhcodo13/lattice@0.4.0 governance check ./monorepo/apps \
79
73
  --workspace-root ./monorepo --policy ./governance/policy.json --expect-apps 3 --json
80
74
  ```
81
75