@jmtrin/opencode-kevin 0.8.0 → 1.0.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/README.md +559 -771
- package/dist/migrations/010_v09_native.sql +78 -0
- package/dist/migrations/011_v10_proven.sql +69 -0
- package/dist/plugin/Archiver.js +0 -1
- package/dist/plugin/ArtifactWriter.d.ts +25 -10
- package/dist/plugin/ArtifactWriter.js +43 -25
- package/dist/plugin/CausalChain.js +0 -1
- package/dist/plugin/ConflictDetector.js +0 -1
- package/dist/plugin/ContextInjector.js +0 -1
- package/dist/plugin/ConventionMiner.js +0 -1
- package/dist/plugin/Curator.js +0 -1
- package/dist/plugin/Feedback.js +0 -1
- package/dist/plugin/HookLiveness.d.ts +87 -0
- package/dist/plugin/HookLiveness.js +338 -0
- package/dist/plugin/InjectionLedger.js +0 -1
- package/dist/plugin/LessonFixer.js +0 -1
- package/dist/plugin/Materializer.d.ts +25 -0
- package/dist/plugin/Materializer.js +39 -11
- package/dist/plugin/MemoryService.js +0 -1
- package/dist/plugin/Migrate.d.ts +1 -0
- package/dist/plugin/Migrate.js +69 -6
- package/dist/plugin/PatternMiner.js +0 -1
- package/dist/plugin/QualityGate.js +0 -1
- package/dist/plugin/Reflector.js +0 -1
- package/dist/plugin/RepoIdentity.d.ts +20 -9
- package/dist/plugin/RepoIdentity.js +44 -10
- package/dist/plugin/RepoTruth.js +0 -1
- package/dist/plugin/Retrospective.js +16 -1
- package/dist/plugin/SharedLayer.js +0 -1
- package/dist/plugin/Store.js +0 -1
- package/dist/plugin/ToolCallObserver.js +0 -1
- package/dist/plugin/capabilities.js +0 -1
- package/dist/plugin/confidence.js +0 -1
- package/dist/plugin/contract.d.ts +46 -0
- package/dist/plugin/contract.js +368 -0
- package/dist/plugin/diff.js +0 -1
- package/dist/plugin/escape.d.ts +39 -0
- package/dist/plugin/escape.js +60 -0
- package/dist/plugin/fingerprint.js +0 -1
- package/dist/plugin/host.d.ts +70 -0
- package/dist/plugin/host.js +250 -0
- package/dist/plugin/index.d.ts +2 -2
- package/dist/plugin/index.js +542 -222
- package/dist/plugin/inferability.js +0 -1
- package/dist/plugin/kevin_approve.js +0 -1
- package/dist/plugin/kevin_audit.d.ts +60 -0
- package/dist/plugin/kevin_audit.js +144 -1
- package/dist/plugin/kevin_bench.d.ts +10 -0
- package/dist/plugin/kevin_bench.js +82 -0
- package/dist/plugin/kevin_conflicts.js +0 -1
- package/dist/plugin/kevin_contract.d.ts +8 -0
- package/dist/plugin/kevin_contract.js +59 -0
- package/dist/plugin/kevin_doctor.d.ts +62 -0
- package/dist/plugin/kevin_doctor.js +196 -0
- package/dist/plugin/kevin_facts.js +0 -1
- package/dist/plugin/kevin_native.d.ts +29 -0
- package/dist/plugin/kevin_native.js +79 -0
- package/dist/plugin/kevin_propose.js +0 -1
- package/dist/plugin/kevin_publish.js +0 -1
- package/dist/plugin/kevin_why.js +0 -1
- package/dist/plugin/memory-format.js +0 -1
- package/dist/plugin/metrics.js +0 -1
- package/dist/plugin/native.d.ts +92 -0
- package/dist/plugin/native.js +190 -0
- package/dist/plugin/okf-export.js +0 -1
- package/dist/plugin/okf-import.js +0 -1
- package/dist/plugin/okf.js +0 -1
- package/dist/plugin/perf.d.ts +35 -0
- package/dist/plugin/perf.js +174 -0
- package/dist/plugin/query-tokenizer.js +0 -1
- package/dist/plugin/redact.js +0 -1
- package/dist/plugin/replay-types.js +0 -1
- package/dist/plugin/replay.js +0 -1
- package/dist/plugin/sqlite-adapter.js +0 -1
- package/dist/plugin/uuid.js +0 -1
- package/package.json +22 -7
- package/dist/plugin/Archiver.js.map +0 -1
- package/dist/plugin/ArtifactWriter.js.map +0 -1
- package/dist/plugin/CausalChain.js.map +0 -1
- package/dist/plugin/ConflictDetector.js.map +0 -1
- package/dist/plugin/ContextInjector.js.map +0 -1
- package/dist/plugin/ConventionMiner.js.map +0 -1
- package/dist/plugin/Curator.js.map +0 -1
- package/dist/plugin/Feedback.js.map +0 -1
- package/dist/plugin/InjectionLedger.js.map +0 -1
- package/dist/plugin/LessonFixer.js.map +0 -1
- package/dist/plugin/Materializer.js.map +0 -1
- package/dist/plugin/MemoryService.js.map +0 -1
- package/dist/plugin/Migrate.js.map +0 -1
- package/dist/plugin/PatternMiner.js.map +0 -1
- package/dist/plugin/QualityGate.js.map +0 -1
- package/dist/plugin/Reflector.js.map +0 -1
- package/dist/plugin/RepoIdentity.js.map +0 -1
- package/dist/plugin/RepoTruth.js.map +0 -1
- package/dist/plugin/Retrospective.js.map +0 -1
- package/dist/plugin/SharedLayer.js.map +0 -1
- package/dist/plugin/Store.js.map +0 -1
- package/dist/plugin/ToolCallObserver.js.map +0 -1
- package/dist/plugin/capabilities.js.map +0 -1
- package/dist/plugin/confidence.js.map +0 -1
- package/dist/plugin/diff.js.map +0 -1
- package/dist/plugin/fingerprint.js.map +0 -1
- package/dist/plugin/index.js.map +0 -1
- package/dist/plugin/inferability.js.map +0 -1
- package/dist/plugin/kevin_approve.js.map +0 -1
- package/dist/plugin/kevin_audit.js.map +0 -1
- package/dist/plugin/kevin_conflicts.js.map +0 -1
- package/dist/plugin/kevin_facts.js.map +0 -1
- package/dist/plugin/kevin_propose.js.map +0 -1
- package/dist/plugin/kevin_publish.js.map +0 -1
- package/dist/plugin/kevin_why.js.map +0 -1
- package/dist/plugin/memory-format.js.map +0 -1
- package/dist/plugin/metrics.js.map +0 -1
- package/dist/plugin/okf-export.js.map +0 -1
- package/dist/plugin/okf-import.js.map +0 -1
- package/dist/plugin/okf.js.map +0 -1
- package/dist/plugin/query-tokenizer.js.map +0 -1
- package/dist/plugin/redact.js.map +0 -1
- package/dist/plugin/replay-types.js.map +0 -1
- package/dist/plugin/replay.js.map +0 -1
- package/dist/plugin/sqlite-adapter.js.map +0 -1
- package/dist/plugin/uuid.js.map +0 -1
- package/migrations/001_initial.sql +0 -92
- package/migrations/002_indexes.sql +0 -14
- package/migrations/003_v02_signal.sql +0 -58
- package/migrations/004_v03_knowledge.sql +0 -138
- package/migrations/005_v04_signal.sql +0 -57
- package/migrations/006_v05_glassbox.sql +0 -118
- package/migrations/007_v06_pull.sql +0 -145
- package/migrations/008_v07_truth.sql +0 -124
- package/migrations/009_v08_team.sql +0 -100
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
-- ============================================================
|
|
2
|
-
-- Kevin 0.8.0 - Migration 009: Team (additive)
|
|
3
|
-
-- ============================================================
|
|
4
|
-
-- Backward-compatible, additive only. All new columns are
|
|
5
|
-
-- nullable or carry a NOT NULL DEFAULT so legacy rows keep
|
|
6
|
-
-- working without a destructive rebuild.
|
|
7
|
-
--
|
|
8
|
-
-- Scope note: this migration introduces `repo_id`, a SECOND
|
|
9
|
-
-- scoping dimension. `project_id` is retained on every table,
|
|
10
|
-
-- unchanged, as local-path provenance (D8-02). Nothing that
|
|
11
|
-
-- reads `project_id` today stops working.
|
|
12
|
-
-- ============================================================
|
|
13
|
-
|
|
14
|
-
-- 1. shared_entries: the local projection of the committed OKF file.
|
|
15
|
-
-- One row per (repo_id, entry_id). Rewritten by SharedLayer.import(),
|
|
16
|
-
-- never edited by hand, never the source of truth - the file is.
|
|
17
|
-
-- No REFERENCES to memories: an entry may arrive from a teammate
|
|
18
|
-
-- before any local memory corresponds to it (D8-12).
|
|
19
|
-
CREATE TABLE IF NOT EXISTS shared_entries (
|
|
20
|
-
id TEXT PRIMARY KEY,
|
|
21
|
-
repo_id TEXT NOT NULL,
|
|
22
|
-
entry_id TEXT NOT NULL,
|
|
23
|
-
type TEXT NOT NULL CHECK (type IN ('decision', 'rule', 'pattern', 'solution')),
|
|
24
|
-
statement TEXT NOT NULL,
|
|
25
|
-
scope TEXT,
|
|
26
|
-
confidence REAL NOT NULL DEFAULT 0.0,
|
|
27
|
-
evidence INTEGER NOT NULL DEFAULT 0,
|
|
28
|
-
origin TEXT NOT NULL DEFAULT 'shared',
|
|
29
|
-
author_hash TEXT,
|
|
30
|
-
op TEXT NOT NULL CHECK (op IN ('assert', 'tombstone')) DEFAULT 'assert',
|
|
31
|
-
supersedes TEXT,
|
|
32
|
-
created_at TEXT NOT NULL,
|
|
33
|
-
imported_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
-- 1b. Identity is (repo_id, entry_id). The UNIQUE index is what makes
|
|
37
|
-
-- import() an idempotent upsert instead of an append.
|
|
38
|
-
CREATE UNIQUE INDEX IF NOT EXISTS uq_shared_entries
|
|
39
|
-
ON shared_entries(repo_id, entry_id);
|
|
40
|
-
CREATE INDEX IF NOT EXISTS idx_shared_entries_op
|
|
41
|
-
ON shared_entries(op);
|
|
42
|
-
CREATE INDEX IF NOT EXISTS idx_shared_entries_type
|
|
43
|
-
ON shared_entries(type);
|
|
44
|
-
|
|
45
|
-
-- 2. okf_imports: append-only audit of every read of the shared file,
|
|
46
|
-
-- including no-op reads and refusals. `file_hash` drives the skip
|
|
47
|
-
-- path in SharedLayer.import() (D8-14).
|
|
48
|
-
CREATE TABLE IF NOT EXISTS okf_imports (
|
|
49
|
-
id TEXT PRIMARY KEY,
|
|
50
|
-
repo_id TEXT NOT NULL,
|
|
51
|
-
path TEXT NOT NULL,
|
|
52
|
-
file_hash TEXT,
|
|
53
|
-
entries_parsed INTEGER NOT NULL DEFAULT 0,
|
|
54
|
-
entries_folded INTEGER NOT NULL DEFAULT 0,
|
|
55
|
-
entries_rejected INTEGER NOT NULL DEFAULT 0,
|
|
56
|
-
skipped INTEGER NOT NULL DEFAULT 0,
|
|
57
|
-
imported_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
CREATE INDEX IF NOT EXISTS idx_okf_imports_repo
|
|
61
|
-
ON okf_imports(repo_id, imported_at);
|
|
62
|
-
|
|
63
|
-
-- 3. memories: the second scoping dimension and the layer marker.
|
|
64
|
-
-- repo_id is NULLABLE and back-filled by the post-apply hook, not by
|
|
65
|
-
-- a DEFAULT: the value depends on the row's existing project_id and
|
|
66
|
-
-- SQLite cannot express that in a column default.
|
|
67
|
-
-- layer carries NO CHECK constraint - widening it later would force
|
|
68
|
-
-- the migration-004 rebuild path (D8-07). Enforced in TypeScript.
|
|
69
|
-
ALTER TABLE memories ADD COLUMN repo_id TEXT;
|
|
70
|
-
ALTER TABLE memories ADD COLUMN layer TEXT NOT NULL DEFAULT 'local';
|
|
71
|
-
ALTER TABLE memories ADD COLUMN shared_entry_id TEXT;
|
|
72
|
-
|
|
73
|
-
CREATE INDEX IF NOT EXISTS idx_memories_repo_id
|
|
74
|
-
ON memories(repo_id, status);
|
|
75
|
-
CREATE INDEX IF NOT EXISTS idx_memories_layer
|
|
76
|
-
ON memories(layer);
|
|
77
|
-
|
|
78
|
-
-- 4. kevin_metrics: seed the six v0.8 counters (33 -> 39).
|
|
79
|
-
INSERT OR IGNORE INTO kevin_metrics (key, value) VALUES
|
|
80
|
-
('shared_entries_total', 0),
|
|
81
|
-
('shared_entries_imported', 0),
|
|
82
|
-
('shared_entries_exported', 0),
|
|
83
|
-
('okf_merge_folds', 0),
|
|
84
|
-
('rekey_events', 0),
|
|
85
|
-
('injections_from_shared', 0);
|
|
86
|
-
|
|
87
|
-
-- 5. kevin_settings: seed the five v0.8 flags (18 -> 23).
|
|
88
|
-
-- shared_layer_enabled defaults OFF: this release must be opted into,
|
|
89
|
-
-- because its first side effect is a new file in the user's repository.
|
|
90
|
-
-- shared_confidence_floor (0.7) is deliberately STRICTER than
|
|
91
|
-
-- injection_confidence_floor (0.6) - see 5.7.
|
|
92
|
-
INSERT OR IGNORE INTO kevin_settings (key, value) VALUES
|
|
93
|
-
('shared_layer_enabled', '0'),
|
|
94
|
-
('okf_path', '.kevin/knowledge.okf'),
|
|
95
|
-
('share_requires_approval', '1'),
|
|
96
|
-
('author_identity_mode', 'hashed'),
|
|
97
|
-
('shared_confidence_floor', '0.7');
|
|
98
|
-
|
|
99
|
-
-- 6. Seed version 009.
|
|
100
|
-
INSERT OR IGNORE INTO schema_version (version) VALUES ('009');
|