@njeybe/nativ 2.3.1 → 2.4.1

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +55 -1
  2. package/README.md +676 -190
  3. package/dist/commands/db.js +3 -0
  4. package/dist/commands/doctor.d.ts +2 -1
  5. package/dist/commands/doctor.js +4 -0
  6. package/dist/commands/init.js +1 -0
  7. package/dist/commands/learn.d.ts +19 -0
  8. package/dist/commands/learn.js +121 -0
  9. package/dist/commands/session.d.ts +22 -0
  10. package/dist/commands/session.js +106 -0
  11. package/dist/commands/task.js +34 -7
  12. package/dist/commands/verify.js +6 -0
  13. package/dist/core/code-shape.js +4 -2
  14. package/dist/core/enforcement.d.ts +1 -0
  15. package/dist/core/enforcement.js +22 -4
  16. package/dist/core/harness-integrity.d.ts +15 -0
  17. package/dist/core/harness-integrity.js +198 -0
  18. package/dist/core/human-gate.d.ts +7 -0
  19. package/dist/core/human-gate.js +16 -0
  20. package/dist/core/learnings.d.ts +63 -0
  21. package/dist/core/learnings.js +227 -0
  22. package/dist/core/root-resolver.d.ts +5 -0
  23. package/dist/core/root-resolver.js +46 -0
  24. package/dist/core/session-memory.d.ts +42 -0
  25. package/dist/core/session-memory.js +121 -0
  26. package/dist/core/setup-assets.d.ts +1 -1
  27. package/dist/core/setup-assets.js +5 -2
  28. package/dist/core/spec-slices.js +119 -7
  29. package/dist/core/verifier.d.ts +36 -0
  30. package/dist/core/verifier.js +92 -4
  31. package/dist/db/introspector.js +59 -59
  32. package/dist/governor/store.d.ts +18 -0
  33. package/dist/governor/store.js +53 -0
  34. package/dist/index.js +41 -0
  35. package/dist/mcp/server.js +12 -0
  36. package/dist/runner/agent-supervisor.d.ts +16 -0
  37. package/dist/runner/agent-supervisor.js +63 -8
  38. package/dist/scanner/types.d.ts +1 -0
  39. package/dist/server/studio-ui/shell/model.js +3 -1
  40. package/package.json +2 -2
  41. package/plugin/.claude-plugin/plugin.json +2 -2
  42. package/plugin/agents/architect.md +3 -3
  43. package/plugin/agents/explorer.md +49 -0
  44. package/plugin/agents/worker.md +2 -1
  45. package/plugin/skills/nativ/SKILL.md +15 -0
  46. package/templates/AGENTS.md +15 -0
  47. package/templates/CLAUDE.md +32 -32
  48. package/templates/GEMINI.md +2 -2
  49. package/templates/claude-agents/architect.md +3 -3
  50. package/templates/claude-agents/explorer.md +49 -0
  51. package/templates/claude-agents/worker.md +2 -1
  52. package/templates/dot-ai/api_contracts.json +66 -66
  53. package/templates/dot-ai/context.md +38 -38
  54. package/templates/dot-ai/db_schema.json +39 -39
  55. package/templates/dot-ai/subagents/frontend.md +33 -0
  56. package/templates/dot-ai/ui_specs.md +17 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,60 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 2.4.1
4
+
5
+ ### Fixed & Improved
6
+
7
+ - **Resilient Spec Slices Resolution.** Enhanced `resolveSpecSlices` in `src/core/spec-slices.ts` to gracefully resolve non-standard and shorthand contract/spec references across `.ai/` contracts:
8
+ - **Shorthand Markdown Section Anchors:** Supports numeric and prefix section references (e.g. `ui_specs.md#6`, `ui_specs.md#15`, `ui_specs.md#15.1`) by matching section prefixes when exact heading slug matches are not found.
9
+ - **JSON Root Keys without Leading Slash:** Automatically resolves JSON references missing a leading slash (e.g. `api_contracts.json#confirmationPageContracts`, `api_contracts.json#legalDocumentsContract`) by falling back to root property pointers and dot-path navigation.
10
+ - **Route Names Lookup:** Resolves named route references (e.g. `api_contracts.json#coaches.payment-qr`, `company.coaches.payment-qr`) across `routingPolicy.playerRoutes`, `venueScopedRoutes`, and other route collections.
11
+ - **Mail Events by Trigger:** Resolves mail event references by trigger name (e.g. `api_contracts.json#Coach Lesson Booked`, `Coach Payment Proof Uploaded`).
12
+ - **Database Schema Tables:** Resolves table references directly by name in `relevantTables` and `tables` collections (e.g. `db_schema.json#legal_documents`, `db_schema.json#coach_bookings`, `db_schema.json#sports`).
13
+
14
+ ## 2.4.0
15
+
16
+ ### Added
17
+
18
+ - **Learnings.** `nativ learn propose` (and the `nativ_learn_propose` MCP tool) records a project
19
+ lesson the contracts do not capture. A human approves it with `nativ learn approve` in an
20
+ interactive terminal, after seeing the full lesson; a lesson that changed during review is not
21
+ decided. Approved lessons reach `nativ task next --json` as `learnings`, scoped to the task's
22
+ role and target files, at most five.
23
+ - **Verify phases.** `verifyPhases` in `.nativ/config.json` lists checks (type check, lint) that
24
+ run before every task's own command in `nativ verify` (once per batch), the `task complete`
25
+ gatekeeper and Studio dispatch. They are always read from the main checkout, and an unreadable
26
+ config fails verification instead of skipping it. A failure names the phase, in Studio too.
27
+ - **Escalation history.** `nativ task next --json` adds `priorEscalations`: the task's settled
28
+ escalations with how each was settled, so a worker does not raise a settled gap again.
29
+ - **Explorer agent.** An `explorer` subagent with only Read, Grep and Glob (Sonnet; the project
30
+ manager passes Haiku for a quick lookup) maps existing code: layout, components, routes, data
31
+ models, conventions, drift against the contracts, and suggested target files for a feature. The
32
+ architect saves its report as `.ai/codebase_map.md` after the human approves, stamped with the
33
+ commit it describes.
34
+ - **Harness checks in `nativ doctor`.** Flags `disableAllHooks` (fail) and `bypassPermissions`
35
+ (warning) in project or local Claude settings, settings files it cannot read, well-known
36
+ credential formats in files agents read (file and line only, never the value), roles with no
37
+ guide, hand-edited role guides, lessons waiting for approval, an unreadable lessons file,
38
+ and a `ui_specs.md` that predates the Marketing pages checks.
39
+
40
+ ### Changed
41
+
42
+ - `nativ task unlock`, `nativ task complete --no-verify` and `nativ db sync --yes` now refuse to run
43
+ without an interactive terminal, like `nativ learn approve`. Agents run headless, so this holds
44
+ even where no permission rule is installed. `task unlock --revoke` still works anywhere.
45
+ - Completing a task closes its pending escalations, and Studio's Needs you no longer lists
46
+ completed tasks.
47
+ - The enforcement hook reads the enforcement mode and unlocks from the main checkout, also inside a
48
+ task worktree, and guards `../..` paths from a worktree into the main checkout's `.ai/`, `.nativ/`
49
+ and secrets.
50
+ - `.nativ/` is protected like `.ai/`: the enforcement hook flags agent edits there, setup adds ask
51
+ rules for it, and Studio's native runner refuses it. Agents are also denied reading
52
+ `.nativ/*.local.json`.
53
+ - Design-time rules (fonts, color, marketing page layout) moved into the Anti-Generic Checklist of
54
+ the `ui_specs.md` template, checked by the architect. The frontend guide keeps build-time rules,
55
+ and its design read applies only to Standard or Full work that renders a screen.
56
+
57
+ ## 2.3.1
4
58
 
5
59
  ### Fixed
6
60