Rinomina: crate akode-*, cartelle akode-rs/ e akode-cli/, binario akode, ~/.akode, AKODE_* (A)

Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
  nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-17 12:37:52 +01:00
parent e37a0deba9
commit 7c1c6dfa8d
10306 changed files with 748026 additions and 748088 deletions

View File

@@ -0,0 +1,38 @@
CREATE TABLE thread_turns (
thread_id TEXT NOT NULL,
turn_id TEXT NOT NULL,
rollout_ordinal INTEGER NOT NULL,
status TEXT NOT NULL,
error_json TEXT,
started_at INTEGER,
completed_at INTEGER,
duration_ms INTEGER,
first_user_item_id TEXT,
final_agent_item_id TEXT,
PRIMARY KEY (thread_id, turn_id)
);
CREATE UNIQUE INDEX idx_thread_turns_page
ON thread_turns(thread_id, rollout_ordinal);
CREATE TABLE thread_items (
thread_id TEXT NOT NULL,
turn_id TEXT NOT NULL,
item_id TEXT NOT NULL,
rollout_ordinal INTEGER NOT NULL,
created_at_ms INTEGER NOT NULL,
item_json TEXT NOT NULL,
PRIMARY KEY (thread_id, turn_id, item_id)
);
CREATE UNIQUE INDEX idx_thread_items_page
ON thread_items(thread_id, rollout_ordinal);
CREATE INDEX idx_thread_items_by_turn_page
ON thread_items(thread_id, turn_id, rollout_ordinal);
CREATE TABLE thread_history_projection_state (
thread_id TEXT PRIMARY KEY,
next_rollout_byte_offset INTEGER NOT NULL,
next_rollout_ordinal INTEGER NOT NULL
);

View File

@@ -0,0 +1,9 @@
ALTER TABLE thread_items ADD COLUMN item_type TEXT NOT NULL DEFAULT '';
UPDATE thread_items
SET item_type = json_extract(item_json, '$.type')
WHERE item_type = '';
CREATE INDEX idx_thread_items_user_messages
ON thread_items(thread_id, rollout_ordinal)
WHERE item_type = 'userMessage';

View File

@@ -0,0 +1,3 @@
ALTER TABLE thread_turns ADD COLUMN rollout_byte_offset INTEGER;
ALTER TABLE thread_turns ADD COLUMN rollout_end_ordinal INTEGER;
ALTER TABLE thread_turns ADD COLUMN rollout_end_byte_offset INTEGER;

View File

@@ -0,0 +1,15 @@
ALTER TABLE thread_items ADD COLUMN updated_at_ordinal INTEGER NOT NULL DEFAULT 0;
-- As of this migration, existing projected items originate from exactly one ItemCompleted rollout
-- event, so their creation ordinal is also their update ordinal.
UPDATE thread_items
SET updated_at_ordinal = rollout_ordinal;
-- Older writers can still append items with the zero default after this migration. Incremental
-- replay excludes those items until a newer writer projects an update for them.
-- Keep this index non-unique so mixed-version writers can continue to persist history.
CREATE INDEX idx_thread_items_updated_page
ON thread_items(thread_id, updated_at_ordinal);
CREATE INDEX idx_thread_items_by_turn_updated_page
ON thread_items(thread_id, turn_id, updated_at_ordinal);

View File

@@ -0,0 +1,22 @@
CREATE TABLE thread_realtime_items (
thread_id TEXT NOT NULL,
item_id TEXT NOT NULL,
rollout_ordinal INTEGER NOT NULL,
created_at_ms INTEGER NOT NULL,
item_type TEXT NOT NULL,
item_json TEXT NOT NULL,
PRIMARY KEY (thread_id, item_id)
);
CREATE UNIQUE INDEX idx_thread_realtime_items_page
ON thread_realtime_items(thread_id, rollout_ordinal);
CREATE INDEX idx_thread_realtime_items_boundary
ON thread_realtime_items(thread_id, rollout_ordinal)
WHERE item_type IN ('realtime_session_started', 'realtime_session_closed');
CREATE TRIGGER thread_realtime_items_projection_cleanup
AFTER DELETE ON thread_history_projection_state
BEGIN
DELETE FROM thread_realtime_items WHERE thread_id = OLD.thread_id;
END;

View File

@@ -0,0 +1,3 @@
CREATE INDEX idx_thread_turns_end_page
ON thread_turns(thread_id, rollout_end_ordinal, turn_id)
WHERE rollout_end_ordinal IS NOT NULL;

View File

@@ -0,0 +1,2 @@
ALTER TABLE thread_items ADD COLUMN started_at_ms INTEGER;
ALTER TABLE thread_items ADD COLUMN completed_at_ms INTEGER;

View File

@@ -0,0 +1 @@
ALTER TABLE thread_turns ADD COLUMN root_turn_id TEXT;