@moreih29/nexus-core 0.9.0 → 0.11.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.
@@ -0,0 +1,88 @@
1
+ # Canonical memory policy vocabulary for .nexus/memory/.
2
+ # Defines categories, naming conventions, access tracking semantics,
3
+ # forgetting policy, and merge preference.
4
+ # Consumers (claude-nexus, opencode-nexus) read this file; specific thresholds
5
+ # and enforcement mechanics are consumer-local.
6
+
7
+ categories:
8
+ - id: empirical
9
+ prefix: empirical-
10
+ description: >
11
+ Empirically verified findings — observations and measurements that the
12
+ project has confirmed through its own experimentation. Examples include
13
+ runtime behavior observations, testing-derived structural facts, and
14
+ operational measurements that cannot be inferred from documentation alone.
15
+ - id: external
16
+ prefix: external-
17
+ description: >
18
+ External constraints and references — requirements imposed by upstream
19
+ dependencies, third-party API limits, vendor documentation quotations, and
20
+ any knowledge that originates outside the project. May become stale if
21
+ the upstream source changes.
22
+ - id: pattern
23
+ prefix: pattern-
24
+ description: >
25
+ Tactical operational patterns — recurring cycle-level recipes, routing
26
+ heuristics, and procedural knowledge developed through work on the project.
27
+ Architectural or design-level patterns belong in .nexus/context/, not here.
28
+
29
+ naming:
30
+ pattern: "^[a-z0-9][a-z0-9-]*\\.md$"
31
+ description: >
32
+ Memory filenames are lowercase kebab-case .md files. The name should be a
33
+ descriptive topic of 2–4 words. An optional category prefix from the
34
+ categories section above may precede the topic. Version numbers and dates
35
+ must not appear in filenames — temporal information belongs inside the file.
36
+ optional_prefix: true
37
+
38
+ access_tracking:
39
+ observation_primitive: file_read
40
+ scope: .nexus/memory/
41
+ description: >
42
+ Harnesses observe the moment an agent reads a memory file. Save events,
43
+ directory scans (glob, grep), and mentions of the path in prose are not
44
+ observation events. The set of events observed determines the accumulated
45
+ access record.
46
+ information_accumulated:
47
+ - name: last_access_timestamp
48
+ meaning: >
49
+ Wall-clock time of the most recent read event. Field name is harness-local;
50
+ the canonical schema for storage is conformance/state-schemas/memory-access.schema.json.
51
+ - name: access_count
52
+ meaning: >
53
+ Cumulative count of read events observed for this file since tracking began.
54
+ - name: last_reader_identity
55
+ meaning: >
56
+ Identifier of the most recent reader (agent id or equivalent). Harness-local
57
+ value domain.
58
+ storage_contract_reference: conformance/state-schemas/memory-access.schema.json
59
+
60
+ forgetting:
61
+ manual_gate_default: true
62
+ description: >
63
+ Manual gc (triggered by the [m:gc] tag) is the default forgetting path.
64
+ Automatic deletion is opt-in per consumer and never runs without explicit
65
+ enablement.
66
+ automatic_deletion_structure:
67
+ principle: minimum_three_signal_intersection
68
+ description: >
69
+ If a consumer enables automatic deletion, the policy must require the
70
+ simultaneous satisfaction of at least three independent signals — for
71
+ example, elapsed time since last access, cycles since last read, and
72
+ cumulative access count. Single-signal automatic deletion is prohibited.
73
+ The specific signal thresholds are consumer-local and must be set to
74
+ match the project's cycle cadence.
75
+ recoverable_deletion_requirement: git_commit
76
+ recoverable_deletion_description: >
77
+ Every memory file deletion must be recorded as a git commit. The commit
78
+ message should include a recovery path that allows the file to be
79
+ reconstructed via git history. Specific commit message format is
80
+ consumer-local.
81
+
82
+ merge:
83
+ principle: merge_before_create
84
+ description: >
85
+ When a new memory save candidate substantively overlaps an existing file
86
+ in topic and category, merging the new content into the existing file is
87
+ preferred over creating a new file. Specific overlap-detection criteria
88
+ (for example, keyword match thresholds) are consumer-local.
@@ -36,12 +36,21 @@ tags:
36
36
  type: inline_action
37
37
  handler: memory_store
38
38
  description: "Stores a lesson or reference to .nexus/memory/"
39
+ prose_guidance: >
40
+ 저장 admission 기준 — 코드/웹에서 다시 얻을 수 없는 정보만 저장한다.
41
+ memory 파일의 naming, category, lifecycle 운영 정책은
42
+ vocabulary/memory_policy.yml과 docs/memory-lifecycle-contract.md를
43
+ canonical source로 참조한다.
39
44
 
40
45
  - id: m-gc
41
46
  trigger: "[m:gc]"
42
47
  type: inline_action
43
48
  handler: memory_gc
44
49
  description: "Garbage-collects .nexus/memory/ by merging or removing stale entries"
50
+ prose_guidance: >
51
+ gc 트리거 조건 평가, merge 판단, forgetting policy 집행은
52
+ vocabulary/memory_policy.yml에 정의된 원칙을 따르고
53
+ 구체 임계값은 consumer-local 설정으로 결정한다.
45
54
 
46
55
  - id: rule
47
56
  trigger: "[rule]"
@@ -0,0 +1,29 @@
1
+ # Canonical exception rules for task decomposition and counting.
2
+ # Each entry defines a condition under which standard task decomposition rules
3
+ # are suspended or modified, along with the alternative treatment to apply.
4
+ # Consumers apply these exceptions during nx-plan task synthesis.
5
+
6
+ task_exceptions:
7
+ - id: docs_only.coherent
8
+ description: "A batch of documentation files that all address the same scheme, decision, or structural change and should be treated as a single coherent unit."
9
+ applies_when: "all changed files are .md or frontmatter-only, and share one common scheme, decision, or structural change"
10
+ treatment: "bundle into 1 writer task + 1 reviewer pair; file count / line count thresholds waived; state coherence claim in task approach field"
11
+ rationale: "e.g., updating agent frontmatter files after a new field is introduced; files share the same change intent"
12
+
13
+ - id: docs_only.independent
14
+ description: "A set of documentation files where each file addresses a distinct topic with no cross-reference dependency."
15
+ applies_when: "each .md file addresses a distinct topic with no cross-reference dependency"
16
+ treatment: "N parallel writer tasks (one per file), each paired with 1 reviewer task; file count threshold waived per-task"
17
+ rationale: "e.g., separate proposal drafts; each file is independently consumed"
18
+
19
+ - id: same_file_bundle
20
+ description: "Two or more decomposed sub-tasks that would each modify the same target file, requiring merger to avoid conflicts."
21
+ applies_when: "two or more sub-tasks in the decomposition would each modify the same target file"
22
+ treatment: "merge sub-tasks into a single task under one owner with a structured prompt listing each sub-task's requirements; the merged task counts as 1 task and 1 artifact cluster; does not apply when sub-tasks are sequenced (A's output feeds B) — those remain separate with a deps relationship"
23
+ rationale: "parallel subagents targeting the same file cause merge conflicts"
24
+
25
+ - id: generated_artifacts
26
+ description: "Files that are build output and do not represent independent authoring decisions."
27
+ applies_when: "files are build output (e.g., paths declared as build outputs in the harness's build configuration)"
28
+ treatment: "excluded from task count, artifact cluster file count, and line count calculations; committed as part of the task that triggers their generation"
29
+ rationale: "generated files do not represent independent authoring decisions"