@h1v35/hivex 0.1.0 → 0.2.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.
@@ -5,170 +5,74 @@ status: accepted
5
5
 
6
6
  # Engineering workflow
7
7
 
8
- Hivex is a TypeScript/Bun product. Modules group behavior by domain responsibility and hide internal
9
- details behind small interfaces. Do not add a second development-session orchestrator or require
10
- an adopting project's layout, tracker or product packages. Codex, Git/GitHub and CI coordinate work.
8
+ Hivex is a TypeScript/Bun product. Modules group behavior by domain responsibility and hide internal details behind small interfaces. Do not add a second development-session orchestrator or require an adopting project's layout, tracker or product packages. Codex, Git/GitHub and CI coordinate work.
11
9
 
12
10
  ## Development and verification
13
11
 
14
- Work is issue-first in `H1V35/hivex`. New vertical work follows discovery where decisions remain open,
15
- then an agreed spec, verifiable execution tickets, implementation and code review. Reuse settled scope
16
- instead of reopening an interview. The owning repository carries the execution ticket; a cross-repository
17
- parent supplies context and coordination, not a substitute for native tracking.
18
-
19
- Resolve the existing spec/ticket before changing code and link the PR and verification to it. Absorb
20
- review findings into the appropriate existing ticket whenever its scope permits. Open a separate issue
21
- only when strictly necessary to preserve independently actionable work, and record why it cannot be
22
- absorbed. Read-only retrieval does not need a new ticket. Specs and tickets track work and acceptance;
23
- resulting durable decisions also enter their repository authority.
24
-
25
- Use an existing issue for an already tracked requirement. Create a branch from the current remote
26
- main, keep each PR to one coherent change and preserve commit history when merging. Never push
27
- directly to main or force-push a shared branch. Apply review findings before acceptance; an invalid
28
- review can be rerun, while an adverse finding must be resolved on its merits. Current explicit owner
29
- authorization governs whether the agent may merge.
30
-
31
- Independent code reviewers use the coordinating agent's current model and reasoning effort. Pass
32
- that profile explicitly when the subagent default differs, and verify the effective configuration
33
- after dispatch. Do not substitute the cheaper knowledge model for code review. Routine implementation subtasks may use an
34
- explicitly authorized cheaper model; Hivex's internal knowledge extraction/checking uses the user's
35
- knowledge-model configuration independently of the development and code-review model.
36
-
37
- Choose verification for the affected surfaces. Code changes require typechecking, lint, formatting
38
- and relevant behavior tests; documentation-only changes need formatting and checks of affected
39
- references or declared sources. Record the exact revision and the checks actually completed. A later
40
- change invalidates the affected results. Do not claim an omitted, interrupted or truncated check passed.
41
-
42
- GitHub Actions runs the quality workflow on the owner's Mac through an official self-hosted runner,
43
- using `[self-hosted, macOS, ARM64, hivex]`. GitHub retains secrets, logs and PR checks; no hosted
44
- runner fallback is configured. No speed benchmark is required. A queued, skipped or interrupted
45
- run is not a pass. Local verification remains required when the runner is unavailable.
46
-
47
- Runner installation is repository administration, outside Hivex's product. Register the admitted
48
- macOS ARM64 release from GitHub's runner settings in its own directory, verify the official checksum,
49
- and use the generated `svc.sh install/start/status/stop` commands. Keep automatic updates enabled,
50
- a stable Homebrew/system PATH and the Mac awake and connected under the logged-in user. The
51
- runner work directory must be separate from the developer checkout and other repository runners.
52
- Only trusted code may run on this persistent host; review that boundary before public contributions.
53
- See [GitHub's runner reference](https://docs.github.com/en/actions/reference/runners/self-hosted-runners).
54
-
55
- During a host migration, disable Actions, register and confirm the runner is online, and merge all
56
- workflow routes before re-enabling Actions. Then dispatch Quality on that exact revision and check
57
- the assigned runner and completed result. The route change alone is not functional verification.
58
-
59
- Use `bun install` for development and `bun ci` for frozen installation. Bun owns dependency
60
- installation through its native configuration and lockfile; Hivex has no custom installer or
61
- registry verifier. See the [installation decision](adr/0003-independent-bun-installation.md).
62
-
63
- The lint configuration owns executable syntax/complexity constraints: cyclomatic complexity 20,
64
- cognitive complexity 15, at most four parameters, nesting depth three and no nested/chained
65
- ternaries. Refactor around meaningful responsibilities rather than adding tiny wrappers merely to
66
- make a number pass. Changes to those limits require a documented decision.
12
+ Work is issue-first in `H1V35/hivex`. New vertical work follows discovery where decisions remain open, then an agreed spec, verifiable execution tickets, implementation and code review. Reuse settled scope instead of reopening an interview. The owning repository carries the execution ticket; a cross-repository parent supplies context and coordination, not a substitute for native tracking.
13
+
14
+ Resolve the existing spec/ticket before changing code and link the PR and verification to it. Absorb review findings into the appropriate existing ticket whenever its scope permits. Open a separate issue only when strictly necessary to preserve independently actionable work, and record why it cannot be absorbed. Read-only retrieval does not need a new ticket. Specs and tickets track work and acceptance; resulting durable decisions also enter their repository authority.
15
+
16
+ Use an existing issue for an already tracked requirement. Create a branch from the current remote main, keep each PR to one coherent change and preserve commit history when merging. Never push directly to main or force-push a shared branch. Apply review findings before acceptance; an invalid review can be rerun, while an adverse finding must be resolved on its merits. Current explicit owner authorization governs whether the agent may merge.
17
+
18
+ Independent code reviewers use the coordinating agent's current model and reasoning effort. Pass that profile explicitly when the subagent default differs, and verify the effective configuration after dispatch. Do not substitute the cheaper knowledge model for code review. Routine implementation subtasks may use an explicitly authorized cheaper model; Hivex's internal knowledge extraction/checking uses the user's knowledge-model configuration independently of the development and code-review model.
19
+
20
+ Choose verification for the affected surfaces. Code changes require typechecking, lint, formatting and relevant behavior tests; documentation-only changes need formatting and checks of affected references or declared sources. Record the exact revision and the checks actually completed. A later change invalidates the affected results. Do not claim an omitted, interrupted or truncated check passed.
21
+
22
+ GitHub Actions runs the quality workflow on the owner's Mac through an official self-hosted runner, using `[self-hosted, macOS, ARM64, hivex]`. GitHub retains secrets, logs and PR checks; no hosted runner fallback is configured. No speed benchmark is required. A queued, skipped or interrupted run is not a pass. Local verification remains required when the runner is unavailable.
23
+
24
+ Runner installation is repository administration, outside Hivex's product. Register the admitted macOS ARM64 release from GitHub's runner settings in its own directory, verify the official checksum, and use the generated `svc.sh install/start/status/stop` commands. Keep automatic updates enabled, a stable Homebrew/system PATH and the Mac awake and connected under the logged-in user. The runner work directory must be separate from the developer checkout and other repository runners. Only trusted code may run on this persistent host; review that boundary before public contributions. See [GitHub's runner reference](https://docs.github.com/en/actions/reference/runners/self-hosted-runners).
25
+
26
+ During a host migration, disable Actions, register and confirm the runner is online, and merge all workflow routes before re-enabling Actions. Then dispatch Quality on that exact revision and check the assigned runner and completed result. The route change alone is not functional verification.
27
+
28
+ Use `bun install` for development and `bun ci` for frozen installation. Bun owns dependency installation through its native configuration and lockfile; Hivex has no custom installer or registry verifier. See the [installation decision](adr/0003-independent-bun-installation.md).
29
+
30
+ Lint uses the published Ultracite ESLint/Prettier core presets with the owner's selected preferences: maximum cyclomatic complexity 20, cognitive complexity 15, nesting depth 3 and four parameters per function; print width 100 and single quotes; unused variables, arguments and caught errors may have a leading `_`, and loose equality is allowed when comparing with `null`. Keep the rest of the presets unchanged. Naming and unused-variable checks allow the leading `_` for unused bindings. The overlapping SonarJS unused-variable rule, `no-eq-null` and optional-catch-binding preference are disabled because they cannot express those exceptions; the configured unused-variable and equality rules still check ordinary names and comparisons. Use `eslint-plugin-boundaries` to enforce actual module responsibilities and keep additional policy minimal and tied to domain behavior. Configuration and dependency versions belong in the executable project configuration. Refactor around meaningful responsibilities instead of adding wrappers to satisfy arbitrary thresholds.
31
+
32
+ The dependency policy follows the current modules: document discovery and Markdown parsing do not import knowledge, review or model execution; knowledge storage and ingestion may use documents; review may use documents and knowledge. Model execution is self-contained, retrieval may use shared errors, and CLI commands compose these responsibilities. Tests may use production modules; production cannot import tests. New source files must be classified before they can participate in these dependencies.
33
+
34
+ Runtime settings identify Bun globals and Bun executables while keeping the preset rules enabled. The browser compatibility target is the server-side JavaScript environment, not a browser application. Runtime APIs used by the code must also be verified on the supported Bun version.
67
35
 
68
36
  ## Tests protect behavior
69
37
 
70
- TDD guides development through meaningful failing examples; it does not require a test for every
71
- function, component, wrapper or line. A test must identify a supported behavior, meaningful invariant
72
- or regression it protects. Prefer the caller's observable interface and results that survive an
73
- internal refactor.
38
+ TDD guides development through meaningful failing examples; it does not require a test for every function, component, wrapper or line. A test must identify a supported behavior, meaningful invariant or regression it protects. Prefer the caller's observable interface and results that survive an internal refactor.
74
39
 
75
- For UI, test visible content, accessibility, interactions and loading/error/empty-state behavior.
76
- Do not freeze arbitrary child arrays, wrapper counts or class/style arrangements. A visual dimension
77
- needs a test only when it is an intentional requirement worth maintaining. For example, displaying
78
- "2 of 4" is a behavior; representing it as exactly three React children is not.
40
+ For UI, test visible content, accessibility, interactions and loading/error/empty-state behavior. Do not freeze arbitrary child arrays, wrapper counts or class/style arrangements. A visual dimension needs a test only when it is an intentional requirement worth maintaining. For example, displaying "2 of 4" is a behavior; representing it as exactly three React children is not.
79
41
 
80
- Mocks, call counts, ordering and exact bytes are not automatically wrong. They can protect an
81
- external protocol, idempotency, a query budget or faithful source reproduction. Their justification
82
- must be the contract, not the current arrangement of internal helpers. Expected results must be
83
- independent examples, not the implementation's own calculation repeated in the test.
42
+ Mocks, call counts, ordering and exact bytes are not automatically wrong. They can protect an external protocol, idempotency, a query budget or faithful source reproduction. Their justification must be the contract, not the current arrangement of internal helpers. Expected results must be independent examples, not the implementation's own calculation repeated in the test.
84
43
 
85
- Review existing tests as retain, rewrite, consolidate or remove. Remove tests for retired behavior
86
- with that behavior; preserve still-needed guarantees at the replacement's actual interface. Do not
87
- port a legacy battery mechanically, chase a test-count target or retain duplicate suites indefinitely.
44
+ Review existing tests as retain, rewrite, consolidate or remove. Remove tests for retired behavior with that behavior; preserve still-needed guarantees at the replacement's actual interface. Do not port a legacy battery mechanically, chase a test-count target or retain duplicate suites indefinitely.
88
45
 
89
46
  ## Files and runtime data have a lifecycle
90
47
 
91
- Create a source file for a meaningful responsibility and a document for a distinct authoritative
92
- purpose. Do not create files for every helper, task, turn, attempt or handoff merely to satisfy a
93
- layout convention or a lint threshold.
48
+ Create a source file for a meaningful responsibility and a document for a distinct authoritative purpose. Do not create files for every helper, task, turn, attempt or handoff merely to satisfy a layout convention or a lint threshold.
94
49
 
95
- Before introducing persistent state, define its purpose, location, owner and retention. Prefer a small
96
- project-local data store to an unbounded tree of per-event files. A per-unit atomic checkpoint can be
97
- a database transaction; it does not require a separate file. Fewer filenames alone do not bound data
98
- growth: cached data, run history and diagnostics also need size/count/age limits and cleanup behavior.
50
+ Before introducing persistent state, define its purpose, location, owner and retention. Prefer a small project-local data store to an unbounded tree of per-event files. A per-unit atomic checkpoint can be a database transaction; it does not require a separate file. Fewer filenames alone do not bound data growth: cached data, run history and diagnostics also need size/count/age limits and cleanup behavior.
99
51
 
100
- Normal read-only queries should leave no per-query artifacts. Clean up owned temporary resources
101
- on ordinary completion and handled failures. Interrupted work must remain recoverable without being
102
- silently retried or discarded. Export diagnostic bundles when needed rather than automatically
103
- writing a new report for every successful step. Retention must preserve the accepted state and the
104
- evidence needed by supported historical/recovery operations; it must not invent a successful cleanup.
52
+ Normal read-only queries should leave no per-query artifacts. Clean up owned temporary resources on ordinary completion and handled failures. Interrupted work must remain recoverable without being silently retried or discarded. Export diagnostic bundles when needed rather than automatically writing a new report for every successful step. Retention must preserve the accepted state and the evidence needed by supported historical/recovery operations; it must not invent a successful cleanup.
105
53
 
106
54
  ## Documentation is maintained authority
107
55
 
108
- Code must be self-explanatory through clear names, structure and behavior. Repository Markdown is
109
- the source of truth for intent, constraints, decisions and reasons that code cannot explain. Do not
110
- write a parallel implementation manual or use documentation to compensate for unclear code.
111
- Accepted source history and Markdown retain authority; caches, model output and search hits do not.
112
- An accepted status alone does not settle amendments, exceptions or contradictions. Keep unresolved
113
- evidence explicit. Never promote a historical agent's description of an owner ruling without
114
- checking its provenance and applicability.
115
-
116
- Capture every decision worth preserving in its appropriate repository document as part of the work.
117
- Do not leave accepted knowledge only in a conversation, issue comment or runtime log. Update the
118
- existing canonical document when it already owns the topic and scope; create a new one only when
119
- it has a distinct purpose. An issue can track the work and preserve discussion, but it is not a
120
- substitute for incorporating the resulting doctrine into the documentation.
121
-
122
- Keep docs with the monorepo, workspace or module they describe. Link to common rules instead of
123
- copying them. Recommended new Markdown should state purpose/scope, use stable headings and suitable
124
- metadata, keep a rule with its conditions/exceptions, and link its sources and replacements. Accept
125
- compatible existing Markdown without forcing those authors to adopt our template. Do not generate
126
- empty documentation for every module or add non-Markdown readers to the current scope.
127
-
128
- Use repository decisions and review evidence for durable knowledge, not private agent memory.
129
- Checkpoints identify the exact commit, verified work and remaining work. Choose a context handoff
130
- when the task needs it; Hivex does not impose the retired machinery's fixed token thresholds.
131
- Knowledge-model operations use the admitted Luna/max profile and record actual usage, including
132
- failed or interrupted attempts. Deterministic retrieval and maintenance do not require a model.
133
-
134
- The replacement workflow follows [ADR 0010](adr/0010-practical-knowledge-assistance.md). It processes
135
- bounded document batches with one additional knowledge check, keeps partial knowledge usable and
136
- preserves a work budget across phases and resumption. A consultation maintains one pending batch
137
- before answering, and a source-based repair replaces interpretations without changing doctrine.
138
- Keep check warnings scoped and public evidence limited to source coordinates, version and text. Avoid a new abstraction or protocol unless it
139
- protects a concrete requirement. The owner-authorized implementation can replace the earlier
140
- cohort/admission pipeline; its historical evidence remains unchanged.
141
-
142
- Hivex assists the principal reviewer with decisions, dependencies, exceptions and possible conflicts.
143
- The reviewer verifies its findings. Missing context or uncertainty limits the conclusions it affects;
144
- a definitive finding must refer to the actual document and implementation versions reviewed.
56
+ Code must be self-explanatory through clear names, structure and behavior. Repository Markdown is the source of truth for intent, constraints, decisions and reasons that code cannot explain. Do not write a parallel implementation manual or use documentation to compensate for unclear code. Accepted source history and Markdown retain authority; caches, model output and search hits do not. An accepted status alone does not settle amendments, exceptions or contradictions. Keep unresolved evidence explicit. Never promote a historical agent's description of an owner ruling without checking its provenance and applicability.
145
57
 
146
- ## Retire mechanisms without losing knowledge
58
+ Capture every decision worth preserving in its appropriate repository document as part of the work. Do not leave accepted knowledge only in a conversation, issue comment or runtime log. Update the existing canonical document when it already owns the topic and scope; create a new one only when it has a distinct purpose. An issue can track the work and preserve discussion, but it is not a substitute for incorporating the resulting doctrine into the documentation.
59
+
60
+ Keep docs with the monorepo, workspace or module they describe. Link to common rules instead of copying them. Recommended new Markdown should state purpose/scope, use stable headings and suitable metadata, keep a rule with its conditions/exceptions, and link its sources and replacements. Accept compatible existing Markdown without forcing those authors to adopt our template. Do not generate empty documentation for every module or add non-Markdown readers to the current scope.
147
61
 
148
- Early use in Compi can support validation and recovery before full retirement. Necessary adoption
149
- and verification work belongs to Hivex completion. Alternative model integrations are evolutionary work;
150
- keep the current Codex/Luna route usable without spreading its assumptions into the knowledge model.
62
+ Use repository decisions and review evidence for durable knowledge, not private agent memory. Checkpoints identify the exact commit, verified work and remaining work. Choose a context handoff when the task needs it; Hivex does not impose the retired machinery's fixed token thresholds. Knowledge-model operations use the admitted Luna/max profile and record actual usage, including failed or interrupted attempts. Deterministic retrieval and maintenance do not require a model.
63
+
64
+ The replacement workflow follows [ADR 0010](adr/0010-practical-knowledge-assistance.md). It processes bounded document batches with one additional knowledge check, keeps partial knowledge usable and preserves a work budget across phases and resumption. A consultation maintains one pending batch before answering, and a source-based repair replaces interpretations without changing doctrine. Keep check warnings scoped and public evidence limited to source coordinates, version and text. Avoid a new abstraction or protocol unless it protects a concrete requirement. The owner-authorized implementation can replace the earlier cohort/admission pipeline; its historical evidence remains unchanged.
65
+
66
+ Hivex assists the principal reviewer with decisions, dependencies, exceptions and possible conflicts. The reviewer verifies its findings. Missing context or uncertainty limits the conclusions it affects; a definitive finding must refer to the actual document and implementation versions reviewed.
67
+
68
+ ## Retire mechanisms without losing knowledge
151
69
 
152
- After knowledge recovery, replacement validation and consumer migration, remove obsolete orchestration
153
- code, scripts, hooks, configuration, tests, dependencies and active instructions. Do not carry an unused
154
- legacy framework into Hivex under another name. Preserve useful decisions in their canonical docs and
155
- retain necessary historical evidence in Git or a bounded private archive outside the active worktree.
156
- Do not rewrite Git history or destroy the accepted Opus graph before its replacement is admitted.
70
+ After knowledge recovery and replacement validation, remove obsolete orchestration code, scripts, hooks, configuration, tests, dependencies and active instructions. Do not carry an unused legacy framework into Hivex under another name. Preserve useful decisions in their canonical docs and retain necessary historical evidence in Git or a bounded private archive outside the active worktree. Do not rewrite Git history or destroy the accepted Opus graph before its replacement is admitted.
157
71
 
158
- Early use can precede complete legacy recovery. Complete closure requires useful historical knowledge
159
- in Markdown, Hivex demonstrated in Compi and the old active machinery retired with its consumers.
160
- Validate the new workflow against bounded real cases, not identity with an old model's graph or an
161
- exhaustive replay prerequisite. Release packages exclude private project evidence and retired runtime.
72
+ A replacement workflow can be used before every historical artifact is retired when the remaining work is explicit. Complete closure requires useful historical knowledge in Markdown and obsolete active machinery retired wherever it is no longer needed. Validate the workflow against bounded real cases, not identity with an old model's graph or an exhaustive replay prerequisite. Release packages exclude private project evidence and retired runtime.
162
73
 
163
74
  ## Distribution
164
75
 
165
- The owner selected `@h1v35/hivex` for the npm package on 2026-09-08, retaining `hivex` as the installed
166
- command, and approved the MIT license. The scoped name avoids the unrelated existing unscoped npm
167
- package. Use an authenticated account authorized for that scope; do not infer npm ownership from a
168
- matching GitHub name. Release preparation must verify the packed contents and exclude private project
169
- evidence and runtime stores. Compi adopts a pinned published version after the complete cycle is
170
- validated; this decision alone does not mean a package has been published.
76
+ The owner selected `@h1v35/hivex` for the npm package on 2026-09-08, retaining `hivex` as the installed command, and approved the MIT license. The scoped name avoids the unrelated existing unscoped npm package. Use an authenticated account authorized for that scope; do not infer npm ownership from a matching GitHub name. Release preparation must verify the packed contents and exclude private project evidence and runtime stores. Project integration follows the normal release process after the complete cycle is validated; this decision alone does not mean a package has been published.
171
77
 
172
- Before publication, inspect and scan the exact package archive for secrets and unintended private
173
- content. Record its hash and the completed scan result; a repack requires a fresh check. Publish the
174
- same verified artifact, not an unchecked reconstruction from a changed working tree.
78
+ Before publication, inspect and scan the exact package archive for secrets and unintended private content. Record its hash and the completed scan result; a repack requires a fresh check. Publish the same verified artifact, not an unchecked reconstruction from a changed working tree.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@h1v35/hivex",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "Versioned project knowledge for people and agents.",
6
6
  "scripts": {
7
7
  "hivex": "bun src/cli.ts",
8
8
  "test": "bun test --timeout 15000 ./src",
9
9
  "typecheck": "node_modules/typescript-native/bin/tsc --noEmit",
10
- "lint": "eslint src test tooling eslint.config.js eslint.base.config.js",
10
+ "lint": "eslint src test eslint.config.js prettier.config.js",
11
11
  "format:check": "prettier --check ."
12
12
  },
13
13
  "dependencies": {
@@ -23,14 +23,31 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@eslint/js": "10.0.1",
26
- "typescript-native": "npm:typescript@7.0.2",
27
- "@types/bun": "1.3.14",
28
- "eslint": "10.7.0",
29
- "eslint-plugin-sonarjs": "1.0.4",
30
- "globals": "16.5.0",
26
+ "@types/bun": "1.4.0",
27
+ "@typescript-eslint/eslint-plugin": "8.69.0",
28
+ "@typescript-eslint/parser": "8.69.0",
29
+ "eslint": "10.9.1",
30
+ "eslint-config-prettier": "10.1.8",
31
+ "eslint-import-resolver-typescript": "4.4.5",
32
+ "eslint-plugin-boundaries": "7.2.0",
33
+ "eslint-plugin-compat": "7.0.2",
34
+ "eslint-plugin-cypress": "7.0.1",
35
+ "eslint-plugin-github": "6.1.2",
36
+ "eslint-plugin-html": "8.2.0",
37
+ "eslint-plugin-import-x": "4.17.1",
38
+ "eslint-plugin-jsdoc": "64.3.5",
39
+ "eslint-plugin-n": "18.3.0",
40
+ "eslint-plugin-prettier": "5.5.6",
41
+ "eslint-plugin-promise": "7.3.0",
42
+ "eslint-plugin-sonarjs": "4.2.0",
43
+ "eslint-plugin-storybook": "10.6.0",
44
+ "eslint-plugin-unicorn": "74.0.0",
45
+ "eslint-plugin-unused-imports": "4.4.1",
46
+ "globals": "17.12.0",
47
+ "prettier": "3.8.4",
31
48
  "typescript": "npm:@typescript/typescript6@6.0.2",
32
- "typescript-eslint": "8.64.0",
33
- "prettier": "3.8.4"
49
+ "typescript-native": "npm:typescript@7.0.2",
50
+ "ultracite": "7.10.8"
34
51
  },
35
52
  "trustedDependencies": [],
36
53
  "packageManager": "bun@1.4.2",
@@ -49,6 +66,7 @@
49
66
  "docs/engineering.md",
50
67
  "docs/adr/0003-independent-bun-installation.md",
51
68
  "docs/adr/0010-practical-knowledge-assistance.md",
69
+ "docs/adr/0011-shared-knowledge-and-selective-history.md",
52
70
  "skills/",
53
71
  "README.md",
54
72
  "LICENSE"
@@ -60,5 +78,8 @@
60
78
  "publishConfig": {
61
79
  "access": "public",
62
80
  "registry": "https://registry.npmjs.org/"
63
- }
81
+ },
82
+ "browserslist": [
83
+ "node 25"
84
+ ]
64
85
  }
@@ -5,104 +5,62 @@ description: Retrieve project decisions and their dependencies and exceptions wi
5
5
 
6
6
  # Hivex
7
7
 
8
- Hivex gives the implementing and reviewing agents project context. Markdown is documentary
9
- authority; the graph is derived assistance. The principal agent remains responsible for the work.
10
- Recover settled decisions before asking the owner to decide them again.
8
+ Hivex gives the implementing and reviewing agents project context. Markdown is documentary authority; the graph is derived assistance. The principal agent remains responsible for the work. Recover settled decisions before asking the owner to decide them again.
11
9
 
12
10
  ## Start with the installed interface
13
11
 
14
- Read the project's agent instructions and source configuration. Run `hivex --help` when the installed
15
- interface is unfamiliar. In a Bun project, `bun hivex` resolves the installed CLI. The package is
16
- `@h1v35/hivex`; do not fetch the unrelated unscoped package.
12
+ Read the project's agent instructions and source configuration. Run `hivex --help` when the installed interface is unfamiliar. In a Bun project, `bun hivex` resolves the installed CLI. The package is `@h1v35/hivex`; do not fetch the unrelated unscoped package.
17
13
 
18
- Use the capabilities advertised by that version. Do not invent commands, silently switch models or
19
- pretend a planned capability exists. Hivex's current validated knowledge profile is Luna/max through
20
- native Codex; the principal agent's model is independent of that choice.
14
+ Use the capabilities advertised by that version. Do not invent commands, silently switch models or pretend a planned capability exists. Hivex's current validated knowledge profile is Luna/max through native Codex; the principal agent's model is independent of that choice.
21
15
 
22
- Native Codex must be able to write its own local state. When the host sandbox prevents that,
23
- use its normal execution-approval mechanism within the existing authorized scope. Keep a failed
24
- launch in the same work history when resuming; an initialization failure is not a model verdict.
16
+ Projects may declare additional historical Markdown with `history` globs in `hivex.json`. Those sources are available to `sources` and `read`, but remain outside ordinary update and consultation selection. Use `--source <document>` with `ask` or `review` for a focused retrieval; a known graph relationship may bring back only the bounded evidence it needs. Explicit `exclude` globs still win, and the CLI continues to reject symlinks, protected directories and paths outside the project.
17
+
18
+ Native Codex must be able to write its own local state. When the host sandbox prevents that, use its normal execution-approval mechanism within the existing authorized scope. Keep a failed launch in the same work history when resuming; an initialization failure is not a model verdict.
25
19
 
26
20
  ## Before implementation
27
21
 
28
- For a coherent feature or behavior change, ask about the intended task and recover the relevant
29
- decisions. Read their evidence and follow relevant dependencies, exceptions and replacements,
30
- including indirect relationships. A search preview or accepted label alone does not settle scope.
22
+ For a coherent feature or behavior change, ask about the intended task and recover the relevant decisions. Read their evidence and follow relevant dependencies, exceptions and replacements, including indirect relationships. A search preview or accepted label alone does not settle scope.
31
23
 
32
- Use Hivex's source/version references. Keep conditions with their rules; a partial exception does
33
- not revoke an entire document. If the evidence answers the question, apply it without asking the
34
- owner again. Ask only when information is missing, sources cannot resolve a real ambiguity or a
35
- new decision requires the owner's involvement. Present the sources, impact and your recommendation.
24
+ Use Hivex's source/version references. Keep conditions with their rules; a partial exception does not revoke an entire document. If the evidence answers the question, apply it without asking the owner again. Ask only when information is missing, sources cannot resolve a real ambiguity or a new decision requires the owner's involvement. Present the sources, impact and your recommendation.
36
25
 
37
- Queries should be focused. Reuse context that remains current rather than asking again per file or
38
- implementation step. Respect declared incomplete exploration and unavailable evidence.
26
+ Queries should be focused. Reuse context that remains current rather than asking again per file or implementation step. Respect declared incomplete exploration and unavailable evidence.
39
27
 
40
28
  ## During review
41
29
 
42
- The principal reviewer directs the review. Run `hivex review "<task>" --base <git-ref>` from the
43
- Git project root. It examines tracked and untracked working changes, recovers relevant documentary
44
- context and makes one review call after at most one update/check batch. The default total budget is
45
- three calls; resume the same task/base with the intended total limit to continue retained work.
46
- Expanding a partial report keeps its work identity and consumed budget; a larger context does not
47
- create another allowance.
30
+ The principal reviewer directs the review. Run `hivex review "<task>" --base <git-ref>` from the Git project root. It examines tracked and untracked working changes, recovers relevant documentary context and makes one review call after at most one update/check batch. The default total budget is three calls; resume the same task/base with the intended total limit to continue retained work. Expanding a partial report keeps its work identity and consumed budget; a larger context does not create another allowance.
48
31
 
49
- Check each finding against its cited before/after code and Markdown versions, including dependencies,
50
- conditions and exceptions. Resolve a demonstrated contradiction before closing the change, by
51
- correcting the implementation or recording an approved decision change. Uncertainty calls for focused
52
- investigation; absence of a finding is not implementation approval. Missing context may be addressed
53
- with a focused task, explicit `--source` or an appropriate context limit, not automatic semantic retries.
32
+ Check each finding against its cited before/after code and Markdown versions, including dependencies, conditions and exceptions. Resolve a demonstrated contradiction before closing the change, by correcting the implementation or recording an approved decision change. Uncertainty calls for focused investigation; absence of a finding is not implementation approval. Missing context may be addressed with a focused task, explicit `--source` or an appropriate context limit, not automatic semantic retries.
54
33
 
55
- Save a report outside the reviewed project or in an ignored path when it must survive the session.
56
- `hivex review --check <saved-report.json> --root <project>` checks documentary and implementation
57
- freshness without a model. A current report is not proof of correct code; a stale report does not
58
- cover subsequent changes. Review output never replaces general code review, lint or tests.
34
+ Save a report outside the reviewed project or in an ignored path when it must survive the session. `hivex review --check <saved-report.json> --root <project>` checks documentary and implementation freshness without a model. A current report is not proof of correct code; a stale report does not cover subsequent changes. Review output never replaces general code review, lint or tests.
59
35
 
60
36
  ## Maintain knowledge
61
37
 
62
- The implementing agent maintains the documents as part of the change. Hivex may identify affected
63
- documents or suggest a correction, but does not rewrite project decisions on its own. Correct an
64
- incorrect graph interpretation against its source; do not alter doctrine to satisfy the model.
38
+ The implementing agent maintains the documents as part of the change. Hivex may identify affected documents or suggest a correction, but does not rewrite project decisions on its own. Correct an incorrect graph interpretation against its source; do not alter doctrine to satisfy the model.
39
+
40
+ Keep documents at their monorepo, package or module authority. Follow the project's existing layout and format. When establishing or improving documentation, use the optional [Markdown convention](references/markdown.md); it is guidance, not an installation prerequisite.
41
+
42
+ Detect new, changed or removed documents before relying on the graph. Use the installed update workflow within the same work budget. Working documents may be queried without a commit, but that state is not approval; preserve the exact versions used by a review. Pending or uncertain knowledge limits the conclusions that depend on it, without making unrelated context unusable.
43
+
44
+ `ask` updates at most one relevant pending batch before answering, under the same total call/input budget. Its default is three calls. Omitted limits preserve a resumed work item's budget. Repeat the same task to resume; changing its budget changes the total ceiling, never the consumed count. Pending corpus coverage is explicit; use `update` when more rounds are needed, rather than issuing repeated identical questions to force indexing.
45
+
46
+ An ordinary consultation does not ingest every declared historical source. A focused source is marked as historical in supplied packets, decisions and evidence, and its extracted decisions retain historical status with their conditions, exceptions, warnings and source ranges. If a required historical dependency is outside the declared scope, inspect `unavailableDocuments` and the reported coverage instead of treating the answer as complete.
65
47
 
66
- Keep documents at their monorepo, package or module authority. Follow the project's existing layout
67
- and format. When establishing or improving documentation, use the optional
68
- [Markdown convention](references/markdown.md); it is guidance, not an installation prerequisite.
48
+ Repair a demonstrably wrong interpretation with `update --repair <document> --reason <correction>`. Check the Markdown first. This revises derived knowledge and its relationships without changing the document or authorizing new policy. Do not use it to suppress a genuine contradiction. Review source-local warnings in their stated scope and inspect `unavailableDocuments` for changed or removed dependencies.
69
49
 
70
- Detect new, changed or removed documents before relying on the graph. Use the installed update
71
- workflow within the same work budget. Working documents may be queried without a commit, but that
72
- state is not approval; preserve the exact versions used by a review. Pending or uncertain knowledge
73
- limits the conclusions that depend on it, without making unrelated context unusable.
50
+ ## Share reusable knowledge
74
51
 
75
- `ask` updates at most one relevant pending batch before answering, under the same total call/input
76
- budget. Its default is three calls. Omitted limits preserve a resumed work item's budget. Repeat the same task to resume; changing its budget changes the
77
- total ceiling, never the consumed count. Pending corpus coverage is explicit; use `update` when more
78
- rounds are needed, rather than issuing repeated identical questions to force indexing.
52
+ `hivex snapshot export` saves the current graph to `.hivex/graph.json`, suitable for Git alongside its Markdown sources. It retains source versions, evidence, available provenance and partial/uncertain coverage; it does not export local attempts, budgets, process locks or model caches. Snapshot commands make no model calls. Keep the SQLite store and locks ignored while allowing the shared JSON file.
79
53
 
80
- Repair a demonstrably wrong interpretation with `update --repair <document> --reason <correction>`.
81
- Check the Markdown first. This revises derived knowledge and its relationships without changing the
82
- document or authorizing new policy. Do not use it to suppress a genuine contradiction. Review source-local
83
- warnings in their stated scope and inspect `unavailableDocuments` for changed or removed dependencies.
54
+ A clone without local knowledge can read the snapshot directly and reuse its matching units on the first update. Existing local knowledge takes precedence; `hivex snapshot import` explicitly adopts the shared graph and refuses if work is unfinished. Preserve that work and its accounting rather than deleting the store to force import. Stale or unavailable source versions remain explicit, and source freshness is not semantic approval. Export when knowledge changes; ordinary reads do not dirty the shared artifact.
84
55
 
85
56
  ## Control consumption
86
57
 
87
- Large Markdown is ingested in bounded rounds. Inspect pending units and coverage, and resume the
88
- same work; do not wipe the store or resend the whole corpus when only a later round remains.
58
+ Large Markdown is ingested in bounded rounds. Inspect pending units and coverage, and resume the same work; do not wipe the store or resend the whole corpus when only a later round remains.
89
59
 
90
- A budget covers the complete work item, its phases and attempts. Resume retained progress with its
91
- original accounting; do not start a fresh counter to bypass an exhausted limit. Separate initial
92
- indexing, maintenance, consultation and review costs and report actual usage and unknown consumption.
93
- Deterministic reads do not require another model call, although the caller consumes context tokens.
60
+ A budget covers the complete work item, its phases and attempts. Resume retained progress with its original accounting; do not start a fresh counter to bypass an exhausted limit. Separate initial indexing, maintenance, consultation and review costs and report actual usage and unknown consumption. Deterministic reads do not require another model call, although the caller consumes context tokens.
94
61
 
95
- Do not automatically retry semantic disagreements or keep correcting until the model says green.
96
- After a crash, use `recover` to inspect retained work. It must not alter live owners or processes.
97
- An explicit `--acknowledge-uncertain` preserves uncertainty and cost; it does not certify a remote
98
- outcome or authorize an automatic retry. Resume only the intended work with its existing budget.
99
- Use `prune` for obsolete completed work and cached responses when needed; keep unfinished work and
100
- export evidence that must outlive cache retention.
62
+ Do not automatically retry semantic disagreements or keep correcting until the model says green. After a crash, use `recover` to inspect retained work. It must not alter live owners or processes. An explicit `--acknowledge-uncertain` preserves uncertainty and cost; it does not certify a remote outcome or authorize an automatic retry. Resume only the intended work with its existing budget. Use `prune` for obsolete completed work and cached responses when needed; keep unfinished work and export evidence that must outlive cache retention.
101
63
 
102
- Preserve useful results and their limits. At a budget boundary, explain what remains and obtain an
103
- authorized extension before spending more. Existing user authorization remains valid; the skill does
104
- not require another permission question for already authorized work.
64
+ Preserve useful results and their limits. At a budget boundary, explain what remains and obtain an authorized extension before spending more. Existing user authorization remains valid; the skill does not require another permission question for already authorized work.
105
65
 
106
- If maintenance reports `context-limit`, inspect `work.contextLimit` for required documents and bytes.
107
- Restore missing evidence or adjust the context bound, then resume the same task. No extraction call
108
- is spent while its known relationship evidence is unavailable or exceeds that bound.
66
+ If maintenance reports `context-limit`, inspect `work.contextLimit` for required documents and bytes. Restore missing evidence or adjust the context bound, then resume the same task. No extraction call is spent while its known relationship evidence is unavailable or exceeds that bound.
@@ -1,17 +1,12 @@
1
1
  # Optional Markdown convention
2
2
 
3
- Use the project's existing Markdown as it is. Hivex must not require this convention, frontmatter,
4
- numbered ADRs or a particular directory structure. Recommend these practices when adopting Hivex or
5
- writing documentation, without repeatedly proposing a migration of an established project.
3
+ Use the project's existing Markdown as it is. Hivex must not require this convention, frontmatter, numbered ADRs or a particular directory structure. Recommend these practices when adopting Hivex or writing documentation, without repeatedly proposing a migration of an established project.
6
4
 
7
- These practices draw on Compi's authority map and documentation layout and the domain-modeling
8
- skill. They preserve the useful documentation discipline, not Compi's retired machinery.
5
+ These practices draw on established authority-map and documentation-layout patterns and the domain-modeling skill. They preserve useful documentation discipline without prescribing retired machinery from any one project.
9
6
 
10
7
  ## Give knowledge one authoritative home
11
8
 
12
- Keep shared decisions at project or monorepo level. Package-specific or module-specific knowledge
13
- can stay with that package or module. Link shared rules instead of copying them into each area.
14
- Folders and files appear only when there is useful content to put in them.
9
+ Keep shared decisions at project or monorepo level. Package-specific or module-specific knowledge can stay with that package or module. Link shared rules instead of copying them into each area. Folders and files appear only when there is useful content to put in them.
15
10
 
16
11
  A useful catalogue distinguishes:
17
12
 
@@ -23,42 +18,32 @@ A useful catalogue distinguishes:
23
18
  - Procedures for concrete operational or recovery tasks.
24
19
  - Research and evidence identified as dated support, not automatically current decisions.
25
20
 
26
- For example, a project may use `docs/README.md`, `docs/CONTEXT.md`, `docs/adr/`,
27
- `docs/guidelines/`, `docs/process/`, `docs/procedures/` and `docs/research/`. These are examples,
28
- not required paths. Multiple bounded contexts may have their own glossary and decisions with a
29
- small context map linking them; a monorepo need not duplicate one shared product glossary.
21
+ For example, a project may use `docs/README.md`, `docs/CONTEXT.md`, `docs/adr/`, `docs/guidelines/`, `docs/process/`, `docs/procedures/` and `docs/research/`. These are examples, not required paths. Multiple bounded contexts may have their own glossary and decisions with a small context map linking them; a monorepo need not duplicate one shared product glossary.
30
22
 
31
23
  ## Write decisions for the next reader
32
24
 
33
- State what was decided and why. Include the scope, conditions and exceptions that change how the
34
- rule is applied. Link the source or decision it depends on or replaces. A short paragraph can be
35
- enough; optional sections should carry information rather than serve as boxes to fill in.
25
+ State what was decided and why. Include the scope, conditions and exceptions that change how the rule is applied. Link the source or decision it depends on or replaces. A short paragraph can be enough; optional sections should carry information rather than serve as boxes to fill in.
36
26
 
37
27
  For a consequential architectural trade-off, an ADR might be:
38
28
 
39
29
  ```markdown
40
30
  # Remove private cached data when access is revoked
41
31
 
42
- Cached private data is removed immediately when access is revoked. The normal cache lifetime
43
- still applies while access remains valid. This prevents stale local access after a permission
44
- change. See the cache policy for the general retention rule.
32
+ Cached private data is removed immediately when access is revoked. The normal cache lifetime still applies while access remains valid. This prevents stale local access after a permission change. See the cache policy for the general retention rule.
45
33
  ```
46
34
 
47
- A title, truthful status and decision date can improve cataloguing. Tags are optional. If a rule is
48
- replaced, identify the replacement and whether the change is partial. Keep the historical reasoning
49
- readable; do not silently rewrite the past. A missing status means uncertainty to resolve from the
50
- content, not permission to assume acceptance.
35
+ A title, truthful status and decision date can improve cataloguing. Tags are optional. If a rule is replaced, identify the replacement and whether the change is partial. Keep the historical reasoning readable; do not silently rewrite the past. A missing status means uncertainty to resolve from the content, not permission to assume acceptance.
51
36
 
52
- Use an ADR when the choice is consequential, reflects a real trade-off and would be surprising
53
- without its rationale. Do not create one for every routine edit or dependency. Sequential names
54
- such as `0001-short-decision.md` are convenient if the project adopts that convention.
37
+ Use an ADR when the choice is consequential, reflects a real trade-off and would be surprising without its rationale. Do not create one for every routine edit or dependency. Sequential names such as `0001-short-decision.md` are convenient if the project adopts that convention.
38
+
39
+ ## Compact an ADR without losing its history
40
+
41
+ When replaced text obscures a decision's current meaning, preserve that history in a clearly marked Markdown archive and keep the active document focused on applicable rules, reasons, dependencies and exceptions. A wholly superseded ADR can remain as a short pointer to its replacement and archive. Preserve referenced anchors or update their links. Do not archive a live exception merely because it is old, or change what an earlier decision meant while shortening its current presentation.
42
+
43
+ A project may use `docs/archive/adr/` for this purpose; other layouts remain valid. Historical evidence should be available for focused consultation without being loaded into every model context. Declare its relative globs in `hivex.json` under `history`, then use the installed CLI's `--source` selection or a known relationship for bounded retrieval. Compaction must not silently make necessary evidence inaccessible. The human or implementing agent maintains these documents; Hivex does not rewrite or move the sources.
55
44
 
56
45
  ## Keep the glossary focused
57
46
 
58
- Define each project-specific concept briefly and use that term consistently. A glossary explains
59
- what a concept is; it is not an implementation manual, task plan or collection of general programming
60
- terms. Group related concepts when it helps and link context-specific definitions instead of copying.
47
+ Define each project-specific concept briefly and use that term consistently. A glossary explains what a concept is; it is not an implementation manual, task plan or collection of general programming terms. Group related concepts when it helps and link context-specific definitions instead of copying.
61
48
 
62
- Code and executable contracts explain mechanics. Markdown preserves the intent, constraints,
63
- decisions and reasons that code cannot explain. Update that knowledge alongside the change rather
64
- than leaving the only explanation in a conversation or private agent memory.
49
+ Code and executable contracts explain mechanics. Markdown preserves the intent, constraints, decisions and reasons that code cannot explain. Update that knowledge alongside the change rather than leaving the only explanation in a conversation or private agent memory.
@@ -1,26 +1,36 @@
1
1
  import { HivexError } from '../errors.ts';
2
2
 
3
- function bounded(text: string) {
3
+ const bounded = (text: string) => {
4
4
  let result = '';
5
5
  for (const char of text) {
6
- if (Buffer.byteLength(JSON.stringify(result + char)) > 256) break;
6
+ if (Buffer.byteLength(JSON.stringify(result + char)) > 256) {
7
+ break;
8
+ }
7
9
  result += char;
8
10
  }
9
11
  return result;
10
- }
11
-
12
- export function diagnostic(error: unknown) {
12
+ };
13
+ export const diagnostic = (error: unknown) => {
13
14
  let failure = new HivexError({
14
15
  code: 'READ_FAILED',
15
16
  message: 'Unable to read project knowledge',
16
17
  });
17
- if (error instanceof HivexError) failure = error;
18
- else if (error instanceof Error)
18
+ if (error instanceof HivexError) {
19
+ failure = error;
20
+ } else if (Error.isError(error)) {
19
21
  failure = new HivexError({ code: 'READ_FAILED', message: error.message });
20
- let details = failure.details;
21
- if (details && Buffer.byteLength(JSON.stringify(details)) > 384) details = { omitted: true };
22
+ }
23
+ let { details } = failure;
24
+ if (details && Buffer.byteLength(JSON.stringify(details)) > 384) {
25
+ details = { omitted: true };
26
+ }
22
27
  const message = bounded(failure.message);
23
28
  return {
24
- error: { code: failure.code, message, messageTruncated: message !== failure.message, details },
29
+ error: {
30
+ code: failure.code,
31
+ details,
32
+ message,
33
+ messageTruncated: message !== failure.message,
34
+ },
25
35
  };
26
- }
36
+ };