Skip to content

Completion of Legacy Polishing - #221

Merged
giovannivolpe merged 37 commits into
developfrom
gv/patch30
Dec 3, 2026
Merged

giovannivolpe merged 37 commits into
developfrom
gv/patch30

Conversation

@giovannivolpe

Copy link
Copy Markdown
Member

No description provided.

The saved generation.block_unrequested_cjk option is now required. Package defaults supply values when creating a project; they no longer fill an absent field when opening a saved profile.

Creation provenance is also mandatory. The profile must contain all five fields:
- created_with_kilin
- created_with_project_type
- created_with_project_type_version
- created_with_project_type_schema_version
- created_with_project_type_sha256
Missing or malformed creation metadata is rejected without rewriting the profile or inventing a creation identity.

The corresponding object contracts are enforced as well: ProjectProfile requires the CJK setting, and QAProject.creation_provenance is required and nonnullable.
One shared validator defines current conversation state
kilin.conversation_format now owns the shared structural validation used by persistence and its consumers. It remains independent of RAG, model, and GUI imports.

The schema distinguishes legitimate lifecycle states from incomplete records:
Area	Enforced behavior
Registration metadata	The complete group may be absent for a core-only conversation; partial registration metadata is invalid.
Resumable history	system_prompt and turns form a complete group.
Completed turns	UUID, timestamp, question, answer, evidence, parameters, and timeline must all be present.
Nullable fields	A valid null must be explicitly stored. Absence no longer substitutes for null.
Fixed records	Unknown fields are rejected.
Turn parameters	Remain extensible, but must contain valid finite JSON values.
Checkpoints	Outer and inner IDs, turn count, and the saved conversation-content hash must agree.

For example, timeline: null remains a valid current untimed answer. A completed turn with no timeline field is rejected.

Evidence records likewise require their complete current fields, including explicit nullable cell and context_role values. Scalar coercions such as converting a string citation into an integer have been removed.

A missing conversation file can start a new history. An existing malformed document, an existing {} document without the canonical envelope, or a nonregular target cannot silently become a new empty history.
Validation precedes persistence and initialization
RAG and TraceLogger validate existing conversation state under the existing ownership rules before project diagnostics, indexing, or model initialization.

Writes validate the complete merged candidate. TraceLogger validates a detached copy so later caller mutation cannot alter the accepted snapshot. Rejected state and failed writes preserve the previous saved conversation bytes and committed in-memory state; turns are committed only after persistence succeeds.

Conversation-store operations use the same validation. Discovery exposes rejected paths and reasons through discovery_errors(), while valid registered conversations remain accessible. An all-invalid catalog raises an error instead of creating an empty replacement conversation.
Consumers use the same schema
Conversation memory, read-only inspectors, GUI file reading, usage totals, and system-test inspection now use the shared current-state validation.

Two additional defects found during implementation are covered:
- A saved memory index cannot bypass the first schema validation in a process merely because its file signatures match. Subsequent unchanged reads can reuse the validated observation.
- GUI usage totals deduplicate by durable turn UUID. Independent answers with identical text and timestamps remain distinct. Invalid usage data in one branch copy cannot hide valid usage from another copy.
The current diagnostic writer’s support for NaN and infinities is preserved outside resumable state. A regression test exercises emit, close, reopen, and RAG loading. Nonfinite values inside resumable parameters are rejected. This preserves the current diagnostic contract without accepting incomplete historical conversation formats.
Use only current versioned macOS runtimes

Remove historical runtime activation without modifying obsolete installations.

Require matching release identity and complete executable entry points.

Reject unsafe managed runtime paths before installation, cleanup or activation.

Preserve atomic activation, locking, failure recovery and existing releases.

Retain current backend repair and legitimate ancestor/interpreter aliases.

Extend regression tests and update developer and release documentation.
@giovannivolpe
giovannivolpe merged commit d43b132 into develop Dec 3, 2026
16 checks passed
@giovannivolpe
giovannivolpe deleted the gv/patch30 branch December 3, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant