agent-enderun 1.11.0 → 1.11.2

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 (64) hide show
  1. package/README.md +14 -6
  2. package/bin/validate-agent-army.js +146 -0
  3. package/dist/src/cli/adapters/paths.js +2 -1
  4. package/dist/src/cli/adapters/paths.js.map +1 -1
  5. package/dist/src/cli/adapters/scaffold.js +5 -1
  6. package/dist/src/cli/adapters/scaffold.js.map +1 -1
  7. package/dist/src/cli/adapters/utils.js +2 -3
  8. package/dist/src/cli/adapters/utils.js.map +1 -1
  9. package/dist/src/cli/commands/init/scaffold-core.js +8 -2
  10. package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
  11. package/dist/src/cli/commands/init/scaffold-standards.js +3 -0
  12. package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
  13. package/dist/src/cli/commands/orchestrate.d.ts +3 -1
  14. package/dist/src/cli/commands/orchestrate.js +40 -4
  15. package/dist/src/cli/commands/orchestrate.js.map +1 -1
  16. package/dist/src/cli/commands/plan.js +2 -1
  17. package/dist/src/cli/commands/plan.js.map +1 -1
  18. package/dist/src/modules/adapters/definitions.js +1 -1
  19. package/dist/src/modules/adapters/definitions.js.map +1 -1
  20. package/dist/src/modules/adapters/shared.js +29 -10
  21. package/dist/src/modules/adapters/shared.js.map +1 -1
  22. package/dist/src/modules/agents/definitions.d.ts +1 -1
  23. package/dist/src/modules/agents/definitions.js +153 -72
  24. package/dist/src/modules/agents/definitions.js.map +1 -1
  25. package/dist/src/modules/agents/registry/analyst.js +4 -0
  26. package/dist/src/modules/agents/registry/analyst.js.map +1 -1
  27. package/dist/src/modules/agents/registry/devops.js +2 -0
  28. package/dist/src/modules/agents/registry/devops.js.map +1 -1
  29. package/dist/src/modules/agents/registry/explorer.js +1 -0
  30. package/dist/src/modules/agents/registry/explorer.js.map +1 -1
  31. package/dist/src/modules/agents/registry/git.js +2 -0
  32. package/dist/src/modules/agents/registry/git.js.map +1 -1
  33. package/dist/src/modules/agents/registry/manager.js +5 -0
  34. package/dist/src/modules/agents/registry/manager.js.map +1 -1
  35. package/dist/src/modules/agents/registry/native.js +4 -0
  36. package/dist/src/modules/agents/registry/native.js.map +1 -1
  37. package/dist/src/shared/constants.d.ts +1 -1
  38. package/dist/src/shared/constants.js +10 -9
  39. package/dist/src/shared/constants.js.map +1 -1
  40. package/dist/tests/adapters/paths.test.js +3 -3
  41. package/dist/tests/adapters/paths.test.js.map +1 -1
  42. package/dist/tests/integration/agent_flow.test.js +2 -2
  43. package/dist/tests/integration/agent_flow.test.js.map +1 -1
  44. package/dist/tests/orchestrate.test.js +2 -7
  45. package/dist/tests/orchestrate.test.js.map +1 -1
  46. package/package.json +2 -2
  47. package/src/cli/adapters/paths.ts +2 -1
  48. package/src/cli/adapters/scaffold.ts +5 -1
  49. package/src/cli/adapters/utils.ts +2 -2
  50. package/src/cli/commands/init/scaffold-core.ts +8 -2
  51. package/src/cli/commands/init/scaffold-standards.ts +3 -0
  52. package/src/cli/commands/orchestrate.ts +41 -4
  53. package/src/cli/commands/plan.ts +2 -1
  54. package/src/modules/adapters/definitions.ts +1 -1
  55. package/src/modules/adapters/shared.ts +33 -10
  56. package/src/modules/agents/definitions.ts +164 -75
  57. package/src/modules/agents/registry/analyst.ts +4 -0
  58. package/src/modules/agents/registry/devops.ts +2 -0
  59. package/src/modules/agents/registry/explorer.ts +1 -0
  60. package/src/modules/agents/registry/git.ts +2 -0
  61. package/src/modules/agents/registry/manager.ts +5 -0
  62. package/src/modules/agents/registry/native.ts +4 -0
  63. package/src/shared/constants.ts +14 -13
  64. package/templates/standards/governance-standards.md +121 -0
@@ -0,0 +1,121 @@
1
+ # 🎖️ Agent Enderun — Governance & Nizam Standards
2
+
3
+ This document defines the supreme governance mandates of the Agent Enderun framework.
4
+ All agents **must** internalize these rules before executing any task.
5
+
6
+ ---
7
+
8
+ ## 1. Constitutional Supremacy
9
+
10
+ - The `ENDERUN.md` file is the **constitution** of every project. Read it at session start.
11
+ - No agent may deviate from constitutional directives, regardless of user instructions.
12
+ - In any conflict between user request and constitutional rule → **constitution wins**.
13
+
14
+ ---
15
+
16
+ ## 2. Phase Wall Protocol (PHASE_0 → PHASE_4)
17
+
18
+ | Phase | Name | Allowed Work |
19
+ |---|---|---|
20
+ | PHASE_0 | Genesis | Init, scaffolding, memory setup |
21
+ | PHASE_1 | Contract | Type contracts, API schema, interface design only |
22
+ | PHASE_2 | Implementation | Feature code, only after Phase 1 contracts approved |
23
+ | PHASE_3 | Quality | Testing, lint, coverage — no new features |
24
+ | PHASE_4 | Release | Deployment, versioning, post-release audit |
25
+
26
+ **Phase Wall Rule:** No agent may begin Phase N+1 work until Phase N is 100% complete.
27
+ A single TODO, lint error, or unverified contract blocks the phase transition.
28
+
29
+ ---
30
+
31
+ ## 3. Trace ID Discipline
32
+
33
+ - Every task chain begins with a unique Trace ID (e.g. `TRC-042`).
34
+ - All agent messages, logs, and commits **must** carry the active Trace ID.
35
+ - Losing a Trace ID is a **Nizam violation** — the task chain must be frozen until recovered.
36
+
37
+ ---
38
+
39
+ ## 4. Surgical Edit Mandate
40
+
41
+ - **Never** overwrite a file fully if only part of it changed.
42
+ - Use `replace_text` or `patch_file` for all code modifications.
43
+ - Full file rewrites are only permitted for files under 50 lines.
44
+ - Violation triggers immediate task freeze.
45
+
46
+ ---
47
+
48
+ ## 5. PII Zero-Tolerance Policy
49
+
50
+ - No agent may log, store, or transmit Personally Identifiable Information (PII).
51
+ - Emails, names, phone numbers in logs → immediate purge required.
52
+ - @manager runs PII scans on all agent outputs before archiving.
53
+
54
+ ---
55
+
56
+ ## 6. High-Risk Operation Gate
57
+
58
+ Operations that require **explicit @manager approval** before execution:
59
+
60
+ - User/Role creation, modification, or deletion
61
+ - Bulk database deletes or schema drops
62
+ - Billing or payment configuration changes
63
+ - Environment variable / secret rotation
64
+ - Force-push to any shared branch
65
+
66
+ **Protocol:** Agent returns a standard refusal → sends `ALERT` to @manager with `requiresApproval: true` → shifts to `WAITING` state.
67
+
68
+ ---
69
+
70
+ ## 7. Memory Integrity Mandate
71
+
72
+ - `PROJECT_MEMORY.md` must be synchronized after **every single turn**.
73
+ - @manager acquires `memory` lock before any write to `PROJECT_MEMORY.md`.
74
+ - Memory drift (outdated state) is classified as **treason** — the manager must detect and correct it.
75
+
76
+ ---
77
+
78
+ ## 8. Locking Protocol
79
+
80
+ ```
81
+ BEFORE writing shared resource:
82
+ 1. acquire_lock(resource, agent)
83
+ 2. Perform write operation
84
+ 3. release_lock(resource, agent)
85
+ ← Never skip step 3, even on error
86
+ ```
87
+
88
+ Resources that require locking: `memory`, `status`, `contracts`, `registry`
89
+
90
+ ---
91
+
92
+ ## 9. Escalation Hierarchy
93
+
94
+ ```
95
+ User / External Request
96
+
97
+ @manager (Supreme Authority)
98
+
99
+ @security (Parallel — always watching)
100
+
101
+ @architect → @backend / @frontend / @database / @devops
102
+
103
+ @quality → @mobile / @native / @explorer / @git / @analyst
104
+ ```
105
+
106
+ Agents may only issue DELEGATION messages **downward** or **sideways** in the hierarchy.
107
+ Never delegate upward — escalate via ALERT instead.
108
+
109
+ ---
110
+
111
+ ## 10. Zero Deviation Policy
112
+
113
+ The following are **unconditional Nizam violations** that freeze all work immediately:
114
+
115
+ - Use of `any` TypeScript type
116
+ - Use of `console.log` in production code (use `logger` instead)
117
+ - Raw SQL strings bypassing Kysely
118
+ - Hardcoded secrets, API keys, or credentials in source files
119
+ - Direct DB calls in controllers (repositories only)
120
+ - Skipping `try-catch` on async operations
121
+ - Missing Trace ID in any agent message