@stackbilt/aegis-core 0.2.0 → 0.4.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.
- package/package.json +11 -3
- package/src/adapters/voice/cloudflare-agent.ts +0 -0
- package/src/bluesky.ts +0 -0
- package/src/claude-tools/content.ts +0 -0
- package/src/claude-tools/email.ts +0 -0
- package/src/codebeast.ts +0 -0
- package/src/content/column.ts +0 -0
- package/src/content/hero-image.ts +0 -0
- package/src/content/index.ts +0 -0
- package/src/content/journal.ts +0 -0
- package/src/content/roundtable.ts +0 -0
- package/src/contracts/agenda-item.contract.ts +113 -0
- package/src/contracts/cc-task.contract.ts +204 -0
- package/src/contracts/goal.contract.ts +147 -0
- package/src/contracts/memory-entry.contract.ts +177 -0
- package/src/core.ts +0 -0
- package/src/dashboard.ts +0 -0
- package/src/decision-docs.ts +0 -0
- package/src/dispatch.ts +0 -0
- package/src/edge-env.ts +0 -0
- package/src/exports.ts +0 -0
- package/src/github-projects.ts +0 -0
- package/src/kernel/argus-actions.ts +0 -0
- package/src/kernel/argus-correlation.ts +0 -0
- package/src/kernel/board.ts +0 -0
- package/src/kernel/classify-memory-topic.ts +0 -0
- package/src/kernel/dynamic-tools.ts +0 -0
- package/src/kernel/executor-port.ts +0 -0
- package/src/kernel/insight-cache.ts +0 -0
- package/src/kernel/memory/insights.ts +0 -0
- package/src/kernel/memory-guardrails.ts +0 -0
- package/src/kernel/port.ts +0 -0
- package/src/kernel/resilience.ts +0 -0
- package/src/kernel/scheduled/agent-dispatch.ts +0 -0
- package/src/kernel/scheduled/argus-analytics.ts +0 -0
- package/src/kernel/scheduled/argus-heartbeat.ts +0 -0
- package/src/kernel/scheduled/argus-notify.ts +0 -0
- package/src/kernel/scheduled/board-sync.ts +0 -0
- package/src/kernel/scheduled/ci-watcher.ts +0 -0
- package/src/kernel/scheduled/content-drip.ts +0 -0
- package/src/kernel/scheduled/content.ts +0 -0
- package/src/kernel/scheduled/conversation-facts.ts +0 -0
- package/src/kernel/scheduled/cost-report.ts +0 -0
- package/src/kernel/scheduled/dev-activity.ts +0 -0
- package/src/kernel/scheduled/digest.ts +0 -0
- package/src/kernel/scheduled/dreaming/agenda-triage.ts +0 -0
- package/src/kernel/scheduled/dreaming/facts.ts +0 -0
- package/src/kernel/scheduled/dreaming/index.ts +0 -0
- package/src/kernel/scheduled/dreaming/llm.ts +0 -0
- package/src/kernel/scheduled/dreaming/pattern-synthesis.ts +0 -0
- package/src/kernel/scheduled/dreaming/persona.ts +0 -0
- package/src/kernel/scheduled/dreaming/symbolic.ts +0 -0
- package/src/kernel/scheduled/dreaming/task-proposals.ts +0 -0
- package/src/kernel/scheduled/entropy.ts +0 -0
- package/src/kernel/scheduled/feed-watcher.ts +0 -0
- package/src/kernel/scheduled/inbox-processor.ts +0 -0
- package/src/kernel/scheduled/issue-proposer.ts +0 -0
- package/src/kernel/scheduled/issue-watcher.ts +0 -0
- package/src/kernel/scheduled/pr-automerge.ts +0 -0
- package/src/kernel/scheduled/product-health.ts +0 -0
- package/src/kernel/scheduled/self-improvement.ts +0 -0
- package/src/kernel/scheduled/social-engage.ts +0 -0
- package/src/kernel/scheduled/task-audit.ts +0 -0
- package/src/landing.ts +0 -0
- package/src/lib/audit-chain/chain.ts +0 -0
- package/src/lib/audit-chain/types.ts +0 -0
- package/src/lib/observability/errors.ts +0 -0
- package/src/operator/config.ts +0 -0
- package/src/operator/persona.ts +0 -0
- package/src/pulse.ts +0 -0
- package/src/routes/bluesky.ts +0 -0
- package/src/routes/codebeast.ts +0 -0
- package/src/routes/content.ts +0 -0
- package/src/routes/dynamic-tools.ts +0 -0
- package/src/routes/observability.ts +0 -0
- package/src/routes/operator-logs.ts +0 -0
- package/src/routes/pages.ts +0 -0
- package/src/schema-enums.ts +0 -0
- package/src/task-intelligence.ts +0 -0
- package/src/ui.ts +0 -0
- package/src/wiki/client.ts +346 -0
- package/src/wiki/types.ts +90 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract } from '@stackbilt/contracts';
|
|
3
|
+
|
|
4
|
+
const ValidationStage = z.enum(['candidate', 'validated', 'expert', 'canonical', 'refuted']);
|
|
5
|
+
|
|
6
|
+
export const MemoryEntryContract = defineContract({
|
|
7
|
+
name: 'MemoryEntry',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
description: 'Semantic memory entry with topic-scoped facts, CRIX validation pipeline, and decay tracking',
|
|
10
|
+
|
|
11
|
+
schema: z.object({
|
|
12
|
+
id: z.number().int().positive(),
|
|
13
|
+
topic: z.string().min(1),
|
|
14
|
+
fact: z.string().min(1),
|
|
15
|
+
factHash: z.string().default(''),
|
|
16
|
+
confidence: z.number().min(0).max(1).default(0.8),
|
|
17
|
+
source: z.string().min(1),
|
|
18
|
+
createdAt: z.string().datetime(),
|
|
19
|
+
updatedAt: z.string().datetime(),
|
|
20
|
+
expiresAt: z.string().datetime().nullable(),
|
|
21
|
+
validUntil: z.string().datetime().nullable(),
|
|
22
|
+
supersededBy: z.number().int().positive().nullable(),
|
|
23
|
+
strength: z.number().int().nonnegative().default(1),
|
|
24
|
+
lastRecalledAt: z.string().datetime().nullable(),
|
|
25
|
+
validationStage: ValidationStage.default('candidate'),
|
|
26
|
+
validators: z.string().nullable(),
|
|
27
|
+
}),
|
|
28
|
+
|
|
29
|
+
operations: {
|
|
30
|
+
record: {
|
|
31
|
+
input: z.object({
|
|
32
|
+
topic: z.string().min(1),
|
|
33
|
+
fact: z.string().min(1),
|
|
34
|
+
source: z.string().min(1),
|
|
35
|
+
confidence: z.number().min(0).max(1).optional(),
|
|
36
|
+
expiresAt: z.string().datetime().optional(),
|
|
37
|
+
}),
|
|
38
|
+
output: 'self' as const,
|
|
39
|
+
emits: ['memory_entry.recorded'],
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
validate: {
|
|
43
|
+
input: z.object({
|
|
44
|
+
id: z.number().int().positive(),
|
|
45
|
+
repo: z.string().min(1),
|
|
46
|
+
confirmed: z.boolean(),
|
|
47
|
+
date: z.string().datetime(),
|
|
48
|
+
}),
|
|
49
|
+
output: 'self' as const,
|
|
50
|
+
transition: { from: 'candidate', to: 'validated' },
|
|
51
|
+
emits: ['memory_entry.validated'],
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
promoteToExpert: {
|
|
55
|
+
input: z.object({ id: z.number().int().positive() }),
|
|
56
|
+
output: 'self' as const,
|
|
57
|
+
transition: { from: 'validated', to: 'expert' },
|
|
58
|
+
emits: ['memory_entry.promoted_expert'],
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
promoteToCanonical: {
|
|
62
|
+
input: z.object({ id: z.number().int().positive() }),
|
|
63
|
+
output: 'self' as const,
|
|
64
|
+
transition: { from: 'expert', to: 'canonical' },
|
|
65
|
+
emits: ['memory_entry.promoted_canonical'],
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
refute: {
|
|
69
|
+
input: z.object({
|
|
70
|
+
id: z.number().int().positive(),
|
|
71
|
+
supersededBy: z.number().int().positive().optional(),
|
|
72
|
+
}),
|
|
73
|
+
output: 'self' as const,
|
|
74
|
+
transition: { from: ['candidate', 'validated', 'expert'], to: 'refuted' },
|
|
75
|
+
emits: ['memory_entry.refuted'],
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
recall: {
|
|
79
|
+
input: z.object({ id: z.number().int().positive() }),
|
|
80
|
+
output: 'self' as const,
|
|
81
|
+
emits: ['memory_entry.recalled'],
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
expire: {
|
|
85
|
+
input: z.object({ id: z.number().int().positive() }),
|
|
86
|
+
output: 'self' as const,
|
|
87
|
+
emits: ['memory_entry.expired'],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
states: {
|
|
92
|
+
field: 'validationStage',
|
|
93
|
+
initial: 'candidate',
|
|
94
|
+
transitions: {
|
|
95
|
+
candidate: {
|
|
96
|
+
validate: 'validated',
|
|
97
|
+
refute: 'refuted',
|
|
98
|
+
},
|
|
99
|
+
validated: {
|
|
100
|
+
promoteToExpert: 'expert',
|
|
101
|
+
refute: 'refuted',
|
|
102
|
+
},
|
|
103
|
+
expert: {
|
|
104
|
+
promoteToCanonical: 'canonical',
|
|
105
|
+
refute: 'refuted',
|
|
106
|
+
},
|
|
107
|
+
canonical: {},
|
|
108
|
+
refuted: {},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
surfaces: {
|
|
113
|
+
api: {
|
|
114
|
+
basePath: '/api/memory',
|
|
115
|
+
routes: {
|
|
116
|
+
record: { method: 'POST', path: '/' },
|
|
117
|
+
validate: { method: 'POST', path: '/:id/validate' },
|
|
118
|
+
promoteToExpert: { method: 'POST', path: '/:id/promote-expert' },
|
|
119
|
+
promoteToCanonical: { method: 'POST', path: '/:id/promote-canonical' },
|
|
120
|
+
refute: { method: 'POST', path: '/:id/refute' },
|
|
121
|
+
recall: { method: 'POST', path: '/:id/recall' },
|
|
122
|
+
expire: { method: 'POST', path: '/:id/expire' },
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
db: {
|
|
126
|
+
table: 'memory_entries',
|
|
127
|
+
indexes: [
|
|
128
|
+
'idx_memory_topic(topic)',
|
|
129
|
+
'idx_memory_dedup(topic, fact_hash)',
|
|
130
|
+
'idx_memory_expires(expires_at)',
|
|
131
|
+
'idx_memory_valid(valid_until)',
|
|
132
|
+
'idx_memory_validation_stage(validation_stage)',
|
|
133
|
+
],
|
|
134
|
+
columnOverrides: {
|
|
135
|
+
createdAt: { default: "datetime('now')" },
|
|
136
|
+
updatedAt: { default: "datetime('now')" },
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
authority: {
|
|
142
|
+
record: { requires: 'role', roles: ['operator', 'system'] },
|
|
143
|
+
validate: { requires: 'role', roles: ['system'] },
|
|
144
|
+
promoteToExpert: { requires: 'role', roles: ['system'] },
|
|
145
|
+
promoteToCanonical: { requires: 'role', roles: ['system'] },
|
|
146
|
+
refute: { requires: 'role', roles: ['operator', 'system'] },
|
|
147
|
+
recall: { requires: 'role', roles: ['system'] },
|
|
148
|
+
expire: { requires: 'role', roles: ['system'] },
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
invariants: [
|
|
152
|
+
{
|
|
153
|
+
name: 'refuted_entry_not_canonical',
|
|
154
|
+
description: 'Canonical entries cannot be refuted — they must be superseded instead',
|
|
155
|
+
check: (entity: unknown) => {
|
|
156
|
+
const m = entity as { validationStage?: string };
|
|
157
|
+
if (m.validationStage === 'canonical') {
|
|
158
|
+
return 'Canonical entries cannot transition to refuted';
|
|
159
|
+
}
|
|
160
|
+
return true;
|
|
161
|
+
},
|
|
162
|
+
appliesTo: ['refute'],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'high_confidence_for_canonical',
|
|
166
|
+
description: 'Canonical entries should have confidence >= 0.9',
|
|
167
|
+
check: (entity: unknown) => {
|
|
168
|
+
const m = entity as { validationStage?: string; confidence?: number };
|
|
169
|
+
if (m.validationStage === 'canonical' && (m.confidence ?? 0) < 0.9) {
|
|
170
|
+
return 'Canonical memory entries require confidence >= 0.9';
|
|
171
|
+
}
|
|
172
|
+
return true;
|
|
173
|
+
},
|
|
174
|
+
appliesTo: ['promoteToCanonical'],
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
});
|
package/src/core.ts
CHANGED
|
File without changes
|
package/src/dashboard.ts
CHANGED
|
File without changes
|
package/src/decision-docs.ts
CHANGED
|
File without changes
|
package/src/dispatch.ts
CHANGED
|
File without changes
|
package/src/edge-env.ts
CHANGED
|
File without changes
|
package/src/exports.ts
CHANGED
|
File without changes
|
package/src/github-projects.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/kernel/board.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/kernel/port.ts
CHANGED
|
File without changes
|
package/src/kernel/resilience.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/landing.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/operator/config.ts
CHANGED
|
File without changes
|
package/src/operator/persona.ts
CHANGED
|
File without changes
|
package/src/pulse.ts
CHANGED
|
File without changes
|
package/src/routes/bluesky.ts
CHANGED
|
File without changes
|
package/src/routes/codebeast.ts
CHANGED
|
File without changes
|
package/src/routes/content.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/routes/pages.ts
CHANGED
|
File without changes
|
package/src/schema-enums.ts
CHANGED
|
File without changes
|
package/src/task-intelligence.ts
CHANGED
|
File without changes
|
package/src/ui.ts
CHANGED
|
File without changes
|