Commit Graph
58 Commits
Author SHA1 Message Date
marcopan 4b584934c8 feat(harness): teardown_to_phase -- artifact teardown on rollback (D15)
Cancella ogni artefatto la cui fase produttrice > target, usando artifacts_out di
workflow.yaml. Risolve il bug latente di ChironeWp3: ctes/*.sql orfani (non piu'
nel piano dopo un re-derive) restavano su disco e bloccavano finalize.
Da chiamare insieme all'append di phase_reopened per mantenere stato coerente.
6 tests (target 4/1/7, empty, missing, orfani CTE). 26 total passing.
2026-06-26 22:37:18 +02:00
marcopan 7d0562b82d feat(harness): phase.py rewrite + effective_decisions (D15 core fix, F2)
The single most important architectural fix vs ChironeWp3: ALL helpers consult
effective_decisions() instead of raw list_decisions(), so the reopen-aware view is
consistent everywhere (fixes the bug where approved_ctes/advance_problems conflated
stale pre-reopen decisions with new ones).

Model (corrected during TDD):
- current_phase folds the audit (excluding retracted) with guard 'n == cur' --
  already reopen-aware (old phase_approved:N after reopen to M<N don't advance).
- effective_decisions = decisions whose phase <= current_phase. A sql_approved at
  phase 7 is stale when current_phase=4 after a rollback to F4, even if in the ledger.
  Rollback to F4 does NOT invalidate decisions of phases 1-3 (they stay effective).
- decision_retracted markers excluded (audit-only).

Also: session/models.py ported (SchemaLinking + Candidate with grounded_values D14a
+ concept_formulas D14b). MAX_PHASE/PHASE_NAMES read from workflow.yaml via
load_workflow() (no duplication). Strada 2: ladder if-phase-N kept for now,
generic prerequisites evaluator (F2 full) deferred.

7 phase tests + 20 total passing.
2026-06-26 22:35:43 +02:00
marcopan fbcd694ace feat(harness): decisions.py ported + decision_retracted for step rollback (D15)
- ported from ChironeWp3 (22 DecisionType, append-only jsonl, monotonic seq)
- added decision_retracted type + retracts field for step-level rollback (D15):
  the retracted decision stays in the audit log, effective_decisions() (Task A5)
  will exclude it from the active view
- 5 tests: retract marker + monotonic seq + retracts default + empty session +
  literal includes retracted. All 13 harness tests pass.
2026-06-26 22:30:16 +02:00
marcopan 4a1272fa0a feat(harness): workflow.yaml as single source of truth + workflow.py loader (F2)
- workflow.yaml: 8-phase definition, data-driven prerequisites, no hardcoded ladder
- workflow.py: load_workflow() reader; max_phase=len(phases), decision_min_phase
  derived from prerequisites scan (no duplication)
- 6 tests: phase count, decision_min_phase derivation, name lookup (incl. F8
  presence -- the JS drift bug structurally impossible now), artifacts_out,
  advance strategy, schema_version. All 8 harness tests pass.
2026-06-26 22:29:17 +02:00
marcopan 2e34ba33e0 docs(spec): allinea §5.1 workspace YAML al Config reale (decisione B, post Task A2)
La prima stesura usava una struttura 'ideale' (relational/vector_db.collection/
embeddings.provider) che non combaciava col modello Config portato da ChironeWp3.
Allineato alla struttura reale (database/rest/vector_rest/vector_write_rest/
vector_db top-level). Aggiunta nota di allineamento + modello delle key D11.
2026-06-26 22:27:05 +02:00
marcopan 6ba3336775 feat(harness): config.py + workspace.py (D3 confine) + chirone.example.yaml
- config.py ported from ChironeWp3, PSD_PROFILE -> THOTH_PROFILE; dual vector key
  (vector_rest/vector_write_rest top-level) preserved verbatim
- workspace.py: thin boundary wrapper (D3) around load_config
- workspaces/chirone.example.yaml: aligned to the real Config shape
- tests/test_workspace.py: 2 tests (env expand + dual key; missing env raises)
- .env.example: added DWH + DOCS_ROOT vars
All tests pass (2/2).
2026-06-26 22:25:00 +02:00
marcopan 72a2c060d4 feat(harness): scaffold project (pyproject, env, gitignore) 2026-06-26 22:17:10 +02:00
marcopan 561e7aef08 chore: init ThothII repo — gitignore references, baseline docs (PRD, spec, harness plan) 2026-06-26 22:00:43 +02:00