Skip to content

Commit cf73758

Browse files
AlexMikhalevclaude
andcommitted
docs: update HANDOVER.md and lessons-learned.md for Phase A+B completion
- Updated HANDOVER.md with all 7 implementation commits and closed issues - Added lessons on Salvo Depot injection, NormalizedTerm builder, schema thesaurus building - Cargo.lock: removed stale static-files transitive deps Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3affdc9 commit cf73758

3 files changed

Lines changed: 341 additions & 108 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HANDOVER.md

Lines changed: 93 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,141 @@
1-
# Handover: 2026-02-23 - v1.10.0 Release Fully Published
1+
# Handover: 2026-03-03 - Phase A+B Implementation Complete
22

3-
**Branch**: `main` (at `dd2ee59c`)
4-
**Release**: v1.10.0 -- https://github.com/terraphim/terraphim-ai/releases/tag/v1.10.0
3+
**Branch**: `main` (at `3affdc98`)
4+
**Release**: v1.11.0 -- https://github.com/terraphim/terraphim-ai/releases/tag/v1.11.0
5+
**CI Status**: GREEN (workspace tests all passing locally)
56

67
---
78

89
## Session Summary
910

10-
Fixed the remaining crates.io publish failure for v1.10.0. The publish script's `update_versions` function had an overly broad `sed` pattern that corrupted dependency versions in multi-line `[dependencies.X]` blocks.
11+
Completed the full Phase A+B implementation plan from `.docs/implementation-plan-2026-03-03.md`. Seven commits implementing bug fixes (#579, #620, flaky webhook test) and the dynamic ontology CLI epic (#544 with children #545-#548). All GitHub issues commented and closed.
1112

1213
---
1314

1415
## What Was Done
1516

16-
### 1. Fixed crates.io Publish Script (PR #574, merged)
17+
### Phase A: Bug Fixes
1718

18-
**Problem**: The `update_versions()` function in `scripts/publish-crates.sh` used `sed -i "s/^version = \".*\"/version = \"$VERSION\"/"` which replaced ALL lines starting with `version = "` -- not just the `[package]` version. This changed `notify`'s version from `"6.1"` to `"1.10.0"` in `terraphim_router/Cargo.toml`, causing `cargo publish` to fail with:
19-
```
20-
error: failed to select a version for the requirement `notify = "^1.10.0"`
21-
```
19+
#### A1: Fix #579 - CLI Config Loading (commit 1844cec0)
2220

23-
**Fix**: Changed the `sed` command to use range addressing (`0,/pattern/` on GNU, `1,/pattern/` on BSD) so only the first occurrence (the `[package]` version line) gets replaced.
21+
Ported the config loading priority chain from terraphim-agent to terraphim-cli:
22+
1. `--config` CLI flag (always loads from JSON, no persistence check)
23+
2. `role_config` in settings.toml (bootstrap-then-persistence)
24+
3. Persistence layer (SQLite)
25+
4. Embedded defaults (hardcoded roles)
2426

25-
**File changed**: `scripts/publish-crates.sh` (lines 196-203)
27+
Bootstrap-then-persistence: first run loads JSON and saves to persistence; subsequent runs use persistence so CLI changes stick.
2628

27-
### 2. Re-tagged v1.10.0 and Triggered Release
29+
#### A2: Fix Flaky Webhook Test (commit 45855954)
2830

29-
- Deleted remote tag `v1.10.0`
30-
- Re-tagged at `dd2ee59c` (includes all three CI fixes)
31-
- Deleted orphaned draft release
32-
- Triggered workflow run 22303128846
31+
Replaced per-request `Settings::from_env()` with Salvo Depot injection. Added `SettingsInjector` middleware that injects `Settings` into the Depot. Tests use `test_router()` helper with deterministic settings via `create_test_settings()`.
3332

34-
### 3. Verified Full Release Success
33+
#### A3: Fix #620 - Signature Verification (commit 43779452)
3534

36-
All critical jobs in run 22303128846 completed successfully:
35+
Downgraded `MissingSignature` from hard error to warning. Self-update now proceeds when archives are unsigned. Verification still runs when signatures exist.
3736

38-
| Job | Status | Duration |
39-
|-----|--------|----------|
40-
| Verify version consistency | PASS | 23s |
41-
| Build binaries (all 7 targets) | PASS | 3m36s - 9m54s |
42-
| Build Debian packages | PASS | 5m0s |
43-
| Build Tauri desktop (all 3 platforms) | PASS | 9m40s - 17m31s |
44-
| Create macOS universal binaries | PASS | 35s |
45-
| Sign and notarize macOS binaries | PASS | 2m48s |
46-
| Create GitHub release | PASS | 25s |
47-
| **Publish Rust crates to crates.io** | **PASS** | **8m34s** |
48-
| Update Homebrew formulas | PASS | 5s |
49-
| Docker 20.04 | Still running | Self-hosted runner |
50-
| Docker 22.04 | Still running | Self-hosted runner |
37+
### Phase B: Dynamic Ontology CLI (Epic #544)
5138

52-
---
39+
#### B1: OntologySchema Types - #547 (commit ab4f2848)
5340

54-
## PRs Merged This Session (cumulative across both sessions)
41+
Added to `terraphim_types`:
42+
- `OntologyEntityType` -- entity type with id, label, uri_prefix, aliases, category
43+
- `OntologyRelationshipType` -- typed relationship between entity types
44+
- `OntologyAntiPattern` -- anti-pattern indicators for governance
45+
- `OntologySchema` -- top-level container with `load_from_file()`, `to_thesaurus_entries()`, `category_ids()`, `uri_for()`
5546

56-
| PR | Title | Fix |
57-
|----|-------|-----|
58-
| #558 | fix(docker): use pre-built frontend assets | Replaced in-container Node.js build with CI-built assets |
59-
| #565 | fix(ci): use 7z instead of zip for Windows | Replaced `zip -j` with `7z a -tzip` |
60-
| #573 | fix(ci): add missing version fields for crates.io | Added `version` to path deps, added new crates to publish list |
61-
| #574 | fix(ci): scope publish script version sed to package section only | Scoped sed to first `version =` line only |
47+
Test fixture: `crates/terraphim_types/test-fixtures/sample_ontology_schema.json`
6248

63-
---
49+
#### B2: Extract with Grounding - #548 (commit 65d25f3f)
6450

65-
## Current State
51+
Added `extract` command to terraphim-cli with `--json` flag:
52+
```bash
53+
terraphim extract "text to analyze" --role "System Operator" --json
54+
```
55+
Returns `ExtractedEntity` list with `GroundingMetadata` (URI, label, provenance, confidence, normalization method).
6656

57+
#### B3: Schema-Based Extraction - #545 (commit 824accb4)
58+
59+
Added `--schema` flag to extract command:
60+
```bash
61+
terraphim extract "text" --schema domain-model.json --json
6762
```
68-
Branch: main
69-
HEAD: dd2ee59c fix(ci): scope publish script version sed to package section only (#574)
70-
Working tree: modified HANDOVER.md, lessons-learned.md (uncommitted)
63+
Builds temporary thesaurus from OntologySchema entity types + aliases, runs Aho-Corasick matching, returns `SchemaSignal` with typed entities and confidence.
64+
65+
#### B4: Coverage Subcommand - #546 (commit 3affdc98)
66+
67+
Added `coverage` subcommand for ontology governance:
68+
```bash
69+
terraphim coverage "text" --schema schema.json --threshold 0.7 --json
7170
```
71+
Computes coverage ratio of schema entity types matched in text. Exits with code 1 when coverage < threshold for CI gate integration.
7272

7373
---
7474

75-
## Blockers and Known Issues
75+
## Commits This Session
7676

77-
1. **Docker builds still running**: Both Docker 20.04 and 22.04 builds are pending on self-hosted runners. Not a code problem -- runner availability issue.
77+
| Commit | Description |
78+
|--------|-------------|
79+
| `1844cec0` | fix(cli): port config loading priority chain from agent to CLI (#579) |
80+
| `45855954` | fix(webhook): inject Settings via Depot instead of per-request env lookup |
81+
| `43779452` | fix(update): downgrade missing signature from error to warning (#620) |
82+
| `ab4f2848` | feat(types): add OntologySchema types for schema-first extraction (#547) |
83+
| `65d25f3f` | feat(cli): add extract command with grounding metadata (#548) |
84+
| `824accb4` | feat(cli): add --schema flag for schema-based extraction (#545) |
85+
| `3affdc98` | feat(cli): add coverage subcommand for ontology governance (#546) |
7886

79-
2. **Tauri desktop bundles not produced**: All three Tauri builds pass, but no `.dmg`, `.AppImage`, `.deb`, `.msi`, or `.nsis` artifacts are uploaded. The Tauri bundle configuration may need updating.
87+
---
88+
89+
## GitHub Issues Updated
8090

81-
3. **Diagnostics warnings** (non-blocking, pre-existing):
82-
- `learning_via_negativa.rs`: unused imports, unused variables, dead code
83-
- `advanced_routing.rs`: unused import `Latency`
84-
- `unified_routing.rs`: unused variable `spawner`
91+
| Issue | Title | Status |
92+
|-------|-------|--------|
93+
| #544 | Epic: Dynamic ontology CLI | Closed |
94+
| #545 | CLI extract --schema outputs SchemaSignal | Closed |
95+
| #546 | CLI coverage --schema --threshold --json | Closed |
96+
| #547 | Define ontology schema file format | Closed |
97+
| #548 | CLI extract includes GroundingMetadata | Closed |
98+
| #579 | CLI config loading priority chain | Closed (was already closed) |
99+
| #620 | Signature verification error | Closed (was already closed) |
85100

86101
---
87102

88-
## Open Issues (Priority Order)
103+
## Current State
89104

90-
| Issue | Title | Priority |
91-
|-------|-------|----------|
92-
| #544 | Dynamic ontology extraction (parent) | High -- new feature |
93-
| #545 | CLI extract --schema outputs SchemaSignal | High -- child of #544 |
94-
| #546 | CLI coverage --schema --threshold --json | High -- child of #544 |
95-
| #547 | Define ontology schema file format | High -- child of #544 |
96-
| #548 | CLI extract includes GroundingMetadata | High -- child of #544 |
97-
| #566 | Cross-compile Windows binaries with cargo-xwin | Medium -- CI optimization |
98-
| #560 | TinyClaw: agent spawning via terraphim_spawner | Medium |
99-
| #561 | TinyClaw: Document standalone architecture | Low |
105+
```
106+
Branch: main
107+
HEAD: 3affdc98 feat(cli): add coverage subcommand for ontology governance (#546)
108+
Working tree: clean (after committing HANDOVER.md and lessons-learned.md)
109+
Tests: All passing (workspace --exclude terraphim_agent)
110+
```
100111

101112
---
102113

103-
## Next Steps (Recommended Priority)
114+
## Files Modified
104115

105-
1. **Monitor Docker builds** -- Check if self-hosted runners complete the Docker 20.04/22.04 builds.
116+
| File | Change |
117+
|------|--------|
118+
| `crates/terraphim_cli/src/service.rs` | Added extract_with_grounding, extract_with_schema, build_thesaurus_from_schema, calculate_coverage, CoverageResult |
119+
| `crates/terraphim_cli/src/main.rs` | Added Extract and Coverage commands, handle_extract, handle_coverage |
120+
| `crates/terraphim_types/src/lib.rs` | Added OntologyEntityType, OntologyRelationshipType, OntologyAntiPattern, OntologySchema |
121+
| `crates/terraphim_types/test-fixtures/sample_ontology_schema.json` | New test fixture |
122+
| `crates/terraphim_github_runner_server/src/main.rs` | SettingsInjector middleware, Depot-based settings |
123+
| `crates/terraphim_update/src/lib.rs` | Downgraded MissingSignature to warning |
106124

107-
2. **Implement issue #544** -- Design plan is complete and posted. Start with #547 (schema file format), then #545 (extract --schema), #546 (coverage --schema), #548 (grounding metadata).
125+
---
108126

109-
3. **Fix Tauri bundle packaging** -- Investigate why no desktop bundles (dmg/AppImage/msi) are produced despite successful builds.
127+
## Blockers and Known Issues
110128

111-
4. **Implement issue #566** (cargo-xwin) -- Lower priority, but will save CI costs long-term.
129+
1. **Docker root-owned files**: Docker builds leave root-owned files in `target/`. Current fix is `sudo chown` before checkout. Cleaner fix would be `--user $(id -u):$(id -g)`.
130+
131+
2. **Bulmaswatch assets in git**: ~4MB of CSS themes tracked in git. Acceptable for now.
112132

113133
---
114134

115-
## Key Patterns Discovered This Session
135+
## Next Steps (Recommended Priority)
116136

117-
- **`sed` first-match-only addressing**: Use `0,/pattern/` (GNU) or `1,/pattern/` (BSD) to replace only the first occurrence. Critical when Cargo.toml files have `version = "..."` in both `[package]` and `[dependencies.X]` sections.
118-
- **Publish script version corruption**: The `update_versions()` function should never use a global `sed` replacement on `version = "..."` because multi-line dependency blocks have their own version lines.
119-
- **crates.io publish takes ~8-10 minutes**: 16 crates with 60-second delays between each.
137+
1. **Phase 4: Verification** -- Run disciplined-verification skill to verify implementation against design
138+
2. **Release v1.12.0** -- Tag and release with new CLI commands
139+
3. **Investigate Docker `--user` flag** -- Avoid root-owned files
140+
4. **Implement #566** -- Cross-compile Windows binaries with cargo-xwin
141+
5. **Implement #560** -- TinyClaw: agent spawning via terraphim_spawner

0 commit comments

Comments
 (0)