H1 batch: GOV-001, AXW-020R/020A/020B/020C - #72
Open
DTALEX66 wants to merge 16 commits into
Open
Conversation
Add optional scope to MachineKnowledgeUnitV1 and filter list_runtime_machine_knowledge by retrieval scope. A scoped approved unit is only visible to retrievals requesting that exact scope; a generic (scope-less) unit remains visible to any retrieval. Existing callers (workspace service, closed_loop, adapters) are backward-compatible via the default None. Fail-closed: a scoped unit never leaks to a different-scope retrieval.
Map H1 domain objects (SourceRecord/Claim/Evidence/LearningArtifact/ MasterySignal/Job/Outbox/Receipt) to existing contracts, tables and adapters so H1 never builds parallel implementations. New RawAsset/Import/Derived/ EvidenceAnchor are explicitly additive where the existing model lacks those semantics.
…state (AXW-020A) Extend RawAssetRecord with mime_type, retention_policy and save_state so the stored asset contract is complete and stable (source, hash, MIME, size, save state, retention). store_original accepts optional mime/retention with sane defaults, preserving backward compatibility with the AXW-012A minimal store.
…XW-020B) ConversionRun converts one raw asset into a DerivedDocument of DerivedBlocks, with stable IDs derived from content identity (raw hash + source + engine), explicit versioning, and aggregate LossReport. Persisted to a local SQLite store with a run->document->block relation. Empty conversions are rejected fail-closed.
…-020C) EvidenceAnchor pins content to a source version by page/block/char-region with a stable anchor id. IndexRevision records a rebuildable derived index (FTS/vector) that points at the raw source hash so it can never be presented as the source of truth; rebuild increments the count against a newer source revision.
GOV-001 review: the legacy row has no scope column, so a scoped unit cannot be round-tripped losslessly. Raise ContractMappingError instead of silently dropping the scope. Adds an adapter behaviour assertion.
DTALEX66
added a commit
that referenced
this pull request
Aug 9, 2026
…(AXW-021A) ImportJobStore + run_import_with_receipt persist the original bytes, convert, and write job + outbox + receipt in a single SQLite transaction reusing the existing workspace job/outbox/receipt store. A conversion failure rolls back the whole set so no orphaned outbox event survives. Same command id is idempotent.
Prove the lease-fenced outbox dispatcher supports AXW-021B: an expired lease from a dead worker is reclaimed with an incremented attempt count (retry), a handler failure is recorded as failed with no delivered_at, and a valid confirmation is required for delivery.
AXW-021A independent review: a conversion failure or a same-command-id conflict rolled back SQLite but left the just-written content-addressed raw file orphaned. Clean up the written byte file on any import failure, and raise ImportJobError consistently (including store_original write failures). Adds orphan-file assertions for both the failure and conflict paths.
DTALEX66
added a commit
that referenced
this pull request
Aug 9, 2026
A Claim may be backed by multiple Evidence nodes. Each node is traceable to a source locator, generation method, review state and provenance. The graph validator rejects evidence belonging to a different claim, caller-supplied evidence without human review, and a claim with no evidence (fail-closed).
Bundle groups evidence about one claim with supports/refutes/qualifies relations, cross-source comparison and conflict detection. Caller-supplied bundles require human review; invalid relations and unknown-evidence references are rejected fail-closed.
…025A) LearningObjective states what a learner must be able to do; RetrievalPractice pairs a prompt with an answer and an explicit scoring rationale. Scoring is driven only by the recorded answer vs expected, never by model confidence (model confidence is accepted but never influences accuracy).
DTALEX66
added a commit
that referenced
this pull request
Aug 9, 2026
TeachBackRecord captures a learner restating a concept; TransferItem applies it to a new situation. Each outcome preserves a human truth/prediction pair (learner self-assessment vs graded truth) tied to the source locator so the result is traceable. Model confidence is never the learning truth.
…XW-030A) The v1 BFF/API responses must never expose internal table names, column names or persistence identifiers; the frontend consumes a versioned DTO, not a raw SQLite projection.
DTALEX66
added a commit
that referenced
this pull request
Aug 9, 2026
…ackend) Serve original PDF bytes to the reader by content hash (sha256: prefixed), read-only and size-bounded, so the frontend PDF.js reader never sees the storage path. Empty/oversized input and non-sha256 keys are rejected fail-closed.
DTALEX66
added a commit
that referenced
this pull request
Aug 9, 2026
…1A review) Independent review warning: run_import_with_receipt failed without recording a durable failure, deviating from the AXW-012A contract. Now a failure record is written (auditable) before the transaction and orphan file are rolled back. Adds a regression test asserting the failure record exists after a failed import.
DTALEX66
added a commit
that referenced
this pull request
Aug 9, 2026
DTALEX66
added a commit
that referenced
this pull request
Aug 10, 2026
Pull the CODEX-frozen execution blueprint, addenda and truth/handoff docs (docs/truth/, docs/taskpacks/) into main, and update README + PROJECT_STATUS to reference them as the authoritative task definition source for H1-H10 and the Web/KLC addenda. H0 (v0.5.1) is merged; H1 backend is in PR #72 (not yet merged), so product capability prose stays scoped to main's actual state. Co-authored-by: DTALEX66 <DTALEX66@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
H1 (RawAsset, Evidence, early learning loop) batch from the frozen execution baseline. Based on
origin/mainf269a01(post-H0 merge). Each change is a separate checkpoint with its own RED→GREEN evidence.Included (6 commits)
ad4480eGOV-001 — Machine Knowledge fail-close: addscopetoMachineKnowledgeUnitV1;list_runtime_machine_knowledge(scope=...)returns only approved units whose scope matches (or generic). A scoped approved unit never leaks to a different scope. Independent read-only review PASS.f09f940GOV-001 review response — legacy row has no scope column; fail closed on scoped unit legacy round-trip (ContractMappingError) instead of silently dropping scope.4a62440AXW-020R — object reuse & migration matrix (SourceRecord/Claim/Evidence/LearningArtifact/MasterySignal/Job/Outbox/Receipt); forbids parallel rebuild.c09379eAXW-020A — complete RawAsset contract: mime_type, retention_policy, save_state added to RawAssetRecord (backward-compatible).bc6cad2AXW-020B — ConversionRun → DerivedDocument → DerivedBlocks with stable content-derived IDs, explicit versioning, LossReport, SQLite persistence (new tables).514841dAXW-020C — EvidenceAnchor (page/block/char-region + source revision) and rebuildable IndexRevision that never presents derived index as source of truth (new tables).Explicitly excluded
codex/frozen-roadmap-deepseek-v1branch).Verification
Risk / Rollback