hafiz-context-manager 0.1.0 → 0.1.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.
- package/dist/config/default/hafiz.yaml +8 -3
- package/dist/config/default/nudge.yaml +1 -1
- package/dist/config/default/roles.yaml +2 -1
- package/dist/config/default/rules/common.md +2 -0
- package/dist/config/default/rules/designer.md +17 -14
- package/dist/config/default/rules/manager.md +2 -1
- package/dist/hafiz.js +2362 -2074
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ tokenizer:
|
|
|
12
12
|
soft_zone: 0.15 # writes within cap*(1+soft_zone) succeed with a notice
|
|
13
13
|
windows: # context window per model family; used for budgets
|
|
14
14
|
default: 200000
|
|
15
|
-
confirm_done:
|
|
15
|
+
confirm_done: ask # ask | auto
|
|
16
16
|
llm:
|
|
17
17
|
# provider: none | kilo | openai-compatible | anthropic | fake (tests). none = condensation
|
|
18
18
|
# disabled (the host's own compaction stays on). kilo = run through Kilo itself (the Kilo plugin
|
|
@@ -34,8 +34,13 @@ onboarding:
|
|
|
34
34
|
directive: >-
|
|
35
35
|
Onboarding: this repo already had code when Hafiz started tracking it. Before planning new
|
|
36
36
|
work, spawn the designer once with hafiz:block={root} to write the root design describing the
|
|
37
|
-
codebase as it is (overview, topology, interface,
|
|
38
|
-
|
|
37
|
+
codebase as it is: stable architecture facts only (overview, topology, interface, true
|
|
38
|
+
constraints). Defects are facts, not rules: each goes in progress (kind found) on the block it
|
|
39
|
+
concerns, and only a full audit becomes a research child block. Existing choices worth keeping
|
|
40
|
+
may be decisions with rationale "existing design"; findings are never decisions until the user
|
|
41
|
+
chooses what to do. Task rules and process notes go in the report, not the store.
|
|
42
|
+
Import what you touch, stub what you call: external dependencies get stubs only where current
|
|
43
|
+
work needs them.
|
|
39
44
|
roles: [manager]
|
|
40
45
|
host:
|
|
41
46
|
kilo:
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# session, when the session starts to look multi-step.
|
|
3
3
|
thresholds: { turns: 15, tool_calls: 25, files_written: 5, subagents_spawned: 1 }
|
|
4
4
|
max_per_session: 1
|
|
5
|
-
template: "Hafiz: this session has {tool_calls} tool calls across {files_written} files
|
|
5
|
+
template: "Hafiz: this session has {tool_calls} tool calls across {files_written} files in a repo Hafiz is not tracking. If this is multi-step work, call hafiz_track_project now (no need to ask)."
|
|
6
6
|
auto_init: false
|
|
@@ -11,7 +11,8 @@ roles:
|
|
|
11
11
|
view: designer
|
|
12
12
|
focus_policy: all_active
|
|
13
13
|
tools: [context.*, block.read, tree.list, block.create, doc.write:design, doc.patch:design,
|
|
14
|
-
edge.*, decision.record, thread
|
|
14
|
+
edge.*, decision.record, thread.*, progress.append:found, progress.append:question]
|
|
15
|
+
# block.create: external stubs, sub-components; progress: findings and questions only
|
|
15
16
|
rules: rules/designer.md
|
|
16
17
|
planner:
|
|
17
18
|
view: default
|
|
@@ -35,3 +35,5 @@ need it again.
|
|
|
35
35
|
- Pass `expected_version` when you edit a document you read. On a conflict, re-read, merge,
|
|
36
36
|
retry.
|
|
37
37
|
- Record facts, not intentions: what changed, what you learned, what was decided.
|
|
38
|
+
- Decisions record choices someone made, not findings. Put findings in progress or, for a full
|
|
39
|
+
audit, a research block.
|
|
@@ -8,8 +8,7 @@ blocks rely on. You do not plan steps or write code.
|
|
|
8
8
|
`constraints`, `rationale` and `references` are optional.
|
|
9
9
|
- root: `overview` and `topology`. research: `question`, then `findings` and `conclusion`.
|
|
10
10
|
external: `interface` only.
|
|
11
|
-
- Sections have token caps
|
|
12
|
-
`rationale`, or record it as a decision.
|
|
11
|
+
- Sections have token caps: write tight prose; put reasoning in `rationale`.
|
|
13
12
|
|
|
14
13
|
**The interface is mandatory and precise.** It is what dependents see instead of your whole
|
|
15
14
|
design.
|
|
@@ -23,8 +22,8 @@ design.
|
|
|
23
22
|
**Writing.**
|
|
24
23
|
- Use `hafiz_doc_write` (type design) for a first design and `hafiz_doc_patch` for edits. Always
|
|
25
24
|
pass the `expected_version` you read.
|
|
26
|
-
- On a conflict,
|
|
27
|
-
|
|
25
|
+
- On a conflict, re-read with `hafiz_block_read`, merge your change into theirs and retry.
|
|
26
|
+
Never overwrite blindly.
|
|
28
27
|
- Interface changes on a block others depend on are breaking. Record why with
|
|
29
28
|
`hafiz_decision_record`.
|
|
30
29
|
|
|
@@ -36,22 +35,26 @@ design.
|
|
|
36
35
|
it only calls (a library, a service, another team's module) gets an `external` block: create
|
|
37
36
|
it with `hafiz_block_create` (kind external), then write only its `interface` with what we use.
|
|
38
37
|
Do not design external code beyond that.
|
|
39
|
-
- Split a block that does two things into child blocks
|
|
40
|
-
|
|
38
|
+
- Split a block that does two things into child blocks (`hafiz_block_create`), each with its own
|
|
39
|
+
interface.
|
|
41
40
|
|
|
42
41
|
**Onboarding an existing codebase.** When spawned on the root of a repo that already had code,
|
|
43
42
|
describe it as it is, not as it should be.
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
|
|
43
|
+
- Skim the layout, entry points, manifests and docs; do not read every file. Write one concise
|
|
44
|
+
root design with stable architecture facts only: `overview`, `topology` (main parts and how
|
|
45
|
+
they connect), `interface` (what the system offers its users) and `constraints` (true project
|
|
46
|
+
constraints, not defects).
|
|
47
|
+
- Describe, do not assess. Existing choices worth keeping (local-only, SQLite) may be decisions
|
|
48
|
+
with rationale "existing design". Findings are never decisions.
|
|
49
|
+
- Defects are facts, not rules: record each with `hafiz_progress_append` (kind `found`; `question` for
|
|
50
|
+
open points) on the block it concerns. Only a full audit becomes a `research` child block.
|
|
51
|
+
- Task rules ("assessment only, no edits") go in your report, never the store; no process or
|
|
52
|
+
tooling notes in design sections.
|
|
53
|
+
- Create blocks only for areas current work touches; stub externals only where called.
|
|
50
54
|
|
|
51
55
|
**Open questions.** If a design question needs the user or the manager, `hafiz_thread_open` it on
|
|
52
56
|
the block and keep designing around it. Park it with a gist (`hafiz_thread_park`) if it stays
|
|
53
57
|
open when you finish. `hafiz_thread_resolve` it when answered, and record the answer with
|
|
54
58
|
`hafiz_decision_record`.
|
|
55
59
|
|
|
56
|
-
**Finish** with a short reply:
|
|
57
|
-
open threads.
|
|
60
|
+
**Finish** with a short reply: blocks designed or changed, interface changes, open threads.
|
|
@@ -14,7 +14,8 @@ below.
|
|
|
14
14
|
|
|
15
15
|
**Onboarding.** If your envelope opens with an onboarding note, the repo had code before Hafiz.
|
|
16
16
|
Do what it says once, before planning new work. The note goes away when the root design is
|
|
17
|
-
written.
|
|
17
|
+
written. Defects found are progress entries on the block they concern, never decisions; record
|
|
18
|
+
a decision only when the user chooses what to do about one.
|
|
18
19
|
|
|
19
20
|
**Delegating.**
|
|
20
21
|
- Every task prompt you give a subagent must contain `hafiz:block=<block-id>` for the block it
|