Files
jarca-ledger-mcp/docs/verification/issue-12-review-60/contract-preservation-inventory.json
T

487 lines
26 KiB
JSON

{
"baseline_revision": "5813dd484196239ab1fac4ba066c5b4922fb33e6",
"reviewed_head": "6a8a27a74ece9a9cce6f9772259677813d91ddf8",
"items": [
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003.01",
"semantic_key": "additive_schema_migration_and_legacy_preservation",
"meaning": "Schema 11 tables, fields, rows, and transactions remain readable; schema 12 adds valuation and snapshot structures and migration is idempotent.",
"reviewed_ids": [
"REQ-003.01",
"REQ-003.01-AC01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"N01"
],
"planned_status": "strengthen_verification_only; semantics_unchanged",
"authorization": "Preserve additive migration, old-row retention, and repeatability; rework may make evidence stricter but may not delete, infer-migrate, or rename legacy data.",
"evidence_paths": [
"jarca_ledger_mcp/infrastructure/sqlite/migrations.py",
"docs/data-model.md",
"tests/test_account_valuations.py::test_account_valuation_schema_is_v12_and_idempotent",
"tests/test_issue_12_regressions.py::test_schema12_migration_preserves_legacy_rows_indexes_and_is_idempotent"
],
"verification": "Reviewed head contains schema-12 documentation and named tests; REQ-001/REQ-002 requirement files are unchanged from baseline."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003.02",
"semantic_key": "verified_leaf_exact_as_of_selection",
"meaning": "Selection is scoped by account, currency, and valuation kind; exact selects same-date verified leaf, as_of selects latest prior verified leaf, and future/unverified/rejected/unknown evidence is excluded or warned.",
"reviewed_ids": [
"REQ-003.02",
"REQ-003.02-AC01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"C05"
],
"planned_status": "strengthen_authority_and_warning_contract; semantics_unchanged",
"authorization": "Only verified leaves remain authoritative; rework may expose more explicit warnings, exclusions, age, and scope but cannot broaden authority.",
"evidence_paths": [
"jarca_ledger_mcp/application/account_valuation_service.py",
"jarca_ledger_mcp/application/assets_service.py",
"docs/interface-contract.md",
"tests/test_account_valuations.py::test_select_exact_and_as_of_excludes_unverified_and_reports_carry_forward",
"tests/test_issue_12_regressions.py::test_preview_warns_about_unverified_candidate_when_verified_value_is_selected"
],
"verification": "Selection terminology, scope, and exclusion rules are documented and backed by focused tests."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003.03",
"semantic_key": "idempotency_and_append_only_correction",
"meaning": "Equal payloads reuse existing rows or runs; changed payloads conflict; corrections append one reasoned child without mutating the parent; invalid parent scope, cycles, self-parent, duplicate child, and source/key conflicts are no-write failures.",
"reviewed_ids": [
"REQ-003.03",
"REQ-003.03-AC01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"C06",
"D03"
],
"planned_status": "strengthen_conflict_and_replay_evidence; semantics_unchanged",
"authorization": "Preserve immutable history, one-child cardinality, request-fingerprint equality, and no-write conflict behavior.",
"evidence_paths": [
"jarca_ledger_mcp/application/account_valuation_service.py",
"jarca_ledger_mcp/application/assets_service.py",
"docs/data-model.md",
"tests/test_account_valuations.py::test_register_same_idempotency_payload_reuses_row_and_changed_payload_conflicts",
"tests/test_account_valuations.py::test_correction_is_append_only_reasoned_and_single_child",
"tests/test_issue_12_review59_account.py::test_direct_correction_requires_matching_existing_parent_and_reason",
"tests/test_issue_12_review59_account.py::test_correction_rejects_self_parent_and_cycles_without_write",
"tests/test_issue_12_review59_reports.py::test_idempotent_snapshot_close_replay_returns_original_immutable_response"
],
"verification": "Current source and tests cover valuation correction, evidence identity, close replay, and no-write conflicts."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003.04",
"semantic_key": "integer_amounts_nullable_optional_metrics_and_representative_liability",
"meaning": "Amounts and optional monetary fields use exact integers; NULL means not provided and zero means explicit zero; investment metrics are not double-counted; only the defined representative loan amount enters liabilities.",
"reviewed_ids": [
"REQ-003.04",
"REQ-003.04-AC01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"N02"
],
"planned_status": "strengthen_field_mapping_and_formula_assertions; semantics_unchanged",
"authorization": "Preserve physical principal fields, NULL/zero distinction, loan definition requirement, and no double sum.",
"evidence_paths": [
"docs/data-model.md",
"docs/interface-contract.md",
"jarca_ledger_mcp/application/account_valuation_service.py",
"jarca_ledger_mcp/application/assets_service.py",
"tests/test_issue_12_review59_account.py::test_valuation_round_trip_preserves_null_zero_and_physical_amount_mapping",
"tests/test_issue_12_regressions.py::test_loan_representative_is_always_aggregated_as_liability",
"tests/test_issue_12_regressions.py::test_loan_balance_fallback_without_representative_definition_is_excluded"
],
"verification": "The reviewed contract explicitly distinguishes NULL, zero, principal meanings, and representative liability."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003.05",
"semantic_key": "current_display_and_historical_authority_separation",
"meaning": "Historical dated evidence does not roll back newer current balance display; account/import writes create only dated unverified candidates when real evidence exists; name-only updates create none.",
"reviewed_ids": [
"REQ-003.05",
"REQ-003.05-AC01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"N01",
"C05"
],
"planned_status": "strengthen_current_cache_and_candidate_provenance; semantics_unchanged",
"authorization": "Preserve separate current and historical decisions, unverified candidate status, and no inferred evidence.",
"evidence_paths": [
"jarca_ledger_mcp/application/accounts_write_services.py",
"jarca_ledger_mcp/application/imports_service.py",
"docs/runtime-flow.md",
"tests/test_account_valuations.py::test_account_balance_write_records_unverified_candidate_only_with_real_basis_date",
"tests/test_account_valuations.py::test_account_name_only_update_does_not_create_candidate",
"tests/test_issue_12_regressions.py::test_historical_account_update_preserves_current_and_adds_one_candidate",
"tests/test_issue_12_review59_account.py::test_import_historical_kb_does_not_replace_newer_current_balance"
],
"verification": "The reviewed head has explicit late-history/current-cache regression tests and runtime decision guards."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003.06",
"semantic_key": "read_only_preview_and_explicit_conditional_close",
"meaning": "Preview performs no database write and reports complete, incomplete, or conditional state; unsafe evidence requires explicit approval metadata; close persists immutable run evidence atomically.",
"reviewed_ids": [
"REQ-003.06",
"REQ-003.06-AC01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"D03",
"D04"
],
"planned_status": "strengthen_preview_fingerprint_and_approval_boundary; semantics_unchanged",
"authorization": "Preserve no-write preview, explicit approval, rejection of unsafe evidence, and atomic close.",
"evidence_paths": [
"jarca_ledger_mcp/application/assets_service.py",
"jarca_ledger_mcp/adapters/streamlit/assets_gateway.py",
"docs/interface-contract.md",
"tests/test_issue_12_regressions.py::test_preview_marks_approval_eligible_missing_valuation_as_incomplete_draft",
"tests/test_issue_12_review59_reports.py::test_dated_manual_asset_is_verified_and_preview_needs_approval",
"tests/test_issue_12_review59_reports.py::test_approved_carried_close_is_conditional_and_persists_provenance",
"tests/test_issue_12_review59_reports.py::test_close_rejects_authority_drift_since_preview"
],
"verification": "Preview/close boundaries, approval fields, drift rejection, and no-partial-write behavior are documented and tested."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003.07",
"semantic_key": "immutable_close_correction_and_net_worth_formula",
"meaning": "Same-basis re-close requires a reason and creates a new run and rows; old runs remain; latest run is report authority; net worth is asset buckets minus representative loan and excludes missing valuations.",
"reviewed_ids": [
"REQ-003.07",
"REQ-003.07-AC01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"C06",
"D03"
],
"planned_status": "strengthen_latest-run_and_formula_provenance; semantics_unchanged",
"authorization": "Preserve append-only runs, correction linkage, latest-run authority, and exact formula.",
"evidence_paths": [
"jarca_ledger_mcp/application/assets_service.py",
"docs/data-model.md",
"tests/test_issue_12_regressions.py::test_empty_conditional_close_is_closed_and_second_close_requires_correction",
"tests/test_issue_12_regressions.py::test_legacy_snapshot_requires_explicit_correction_before_new_close",
"tests/test_issue_12_review59_reports.py::test_asset_close_and_report_expose_provenance_aliases"
],
"verification": "Run correction fields, latest authority, and formula semantics are present in canonical docs and tests."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003.08",
"semantic_key": "reconciliation_and_monthly_read_model_propagation",
"meaning": "Verified investment uses VALUATION_MANAGED without fake transactions; incomplete evidence reports unavailable/incomplete calculation; monthly and downstream reports propagate actual valuation date, age, carry, verification, run, approval, correction, warnings, and exclusions.",
"reviewed_ids": [
"REQ-003.08",
"REQ-003.08-AC01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"C05",
"D04"
],
"planned_status": "strengthen_cross_read_model_alias_and_completeness_contract; semantics_unchanged",
"authorization": "Preserve read-only propagation, explicit incompleteness, no inferred balance, and monthly_source_snapshot_id as a read-model alias only.",
"evidence_paths": [
"jarca_ledger_mcp/application/reconciliation_service.py",
"jarca_ledger_mcp/application/monthly_settlement_service.py",
"jarca_ledger_mcp/adapters/streamlit/overview_gateway.py",
"docs/data-model.md",
"tests/test_issue_12_regressions.py::test_reconciliation_uses_corrected_investment_leaf_without_transaction_count_change",
"tests/test_issue_12_review59_reports.py::test_investment_without_verified_valuation_and_without_opening_balance_is_incomplete",
"tests/test_issue_12_review59_reports.py::test_timeseries_and_monthly_expose_canonical_asset_provenance",
"tests/test_issue_12_review59_reports.py::test_monthly_settlement_propagates_snapshot_provenance_id_and_actual_valuation_date"
],
"verification": "Named source owners and report propagation tests cover reconciliation and monthly semantics."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003.09",
"semantic_key": "shared_application_adapters_and_auth_boundary",
"meaning": "MCP and Dashboard delegate to shared services, retain success/error envelopes, require Dashboard authentication before DB access, and keep render/read paths non-mutating.",
"reviewed_ids": [
"REQ-003.09",
"REQ-003.09-AC01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"N01",
"D04"
],
"planned_status": "strengthen_adapter_and_auth-order assertions; semantics_unchanged",
"authorization": "Preserve shared policy ownership, thin adapters, auth-before-DB, and existing MCP authentication scope.",
"evidence_paths": [
"jarca_ledger_mcp/adapters/mcp/server.py",
"jarca_ledger_mcp/adapters/streamlit/accounts_gateway.py",
"jarca_ledger_mcp/adapters/streamlit/overview_gateway.py",
"dashboard/app.py",
"tests/test_contract_regression.py",
"tests/test_dashboard_app.py",
"tests/test_dashboard_menu_transition.py"
],
"verification": "The reviewed head retains named adapter paths and existing REQ-001/REQ-002 gates; requirement files are unchanged from baseline."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003.10",
"semantic_key": "synthetic_privacy_and_excluded_scope",
"meaning": "Docs, tests, fixtures, and evidence contain only synthetic/redacted data; credentials, tokens, cookies, real financial data, external prices, FX, automatic approval, inferred transactions, and redesign remain out of scope.",
"reviewed_ids": [
"REQ-003.10",
"REQ-003.10-AC01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"N02",
"D04"
],
"planned_status": "strengthen_recursive_redaction_and_static_inventory; semantics_unchanged",
"authorization": "Preserve privacy boundary and excluded scope; rework may add redaction checks but may not introduce real data or new financial inference.",
"evidence_paths": [
"docs/project-structure.md",
"docs/interface-contract.md",
"tests/test_requirement_docs.py",
"tests/test_issue_12_review59_reports.py::test_close_metadata_is_allowlisted_recursively",
"tests/test_issue_12_review59_reports.py::test_public_included_items_redact_source_note_and_memo_recursively"
],
"verification": "Canonical docs state synthetic-only and recursive redaction; focused tests validate metadata and evidence redaction."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003-INV01",
"semantic_key": "authority_and_safety_invariants",
"meaning": "Only verified leaves are authority; future/unverified/rejected/unknown evidence is not summed; preview/render do not write; close is transactional; current and historical authority remain separate.",
"reviewed_ids": [
"REQ-003-INV01"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"C05",
"D03",
"D04"
],
"planned_status": "strengthen explicit invariant checks; semantics_unchanged",
"authorization": "All listed invariants are preservation constraints, not permission to alter business meaning.",
"evidence_paths": [
"docs/requirements/req-003_account-valuation-history.md",
"docs/data-model.md",
"docs/runtime-flow.md",
"tests/test_issue_12_regressions.py",
"tests/test_issue_12_review59_reports.py"
],
"verification": "The requirement, data model, and runtime flow repeat the same authority and no-write invariants."
},
{
"path": "docs/requirements/req-003_account-valuation-history.md",
"baseline_id": "REQ-003-INV02",
"semantic_key": "database_read_lifecycle_boundary",
"meaning": "Writer/bootstrap explicitly calls init_db; read_db uses SQLite mode=ro; missing DB returns db_not_initialized without mkdir/migrate/commit; initialized read failure returns db_error.",
"reviewed_ids": [
"REQ-003-INV02"
],
"reviewed_status": "present_and_approved",
"planned_ids": [
"N01"
],
"planned_status": "strengthen_no_create_and_error_classification; semantics_unchanged",
"authorization": "Preserve explicit initialization and stable read-only failure envelopes.",
"evidence_paths": [
"jarca_ledger_mcp/infrastructure/sqlite/connection.py",
"jarca_ledger_mcp/infrastructure/sqlite/migrations.py",
"docs/interface-contract.md",
"docs/runtime-flow.md",
"tests/test_issue_12_review59_readonly.py::test_read_queries_missing_nested_db_return_stable_error_without_creating_path",
"tests/test_issue_12_review59_readonly.py::test_read_schema_error_is_not_misreported_as_uninitialized"
],
"verification": "C13 database-boundary documentation and focused read-only tests exist at reviewed head."
},
{
"path": "docs/requirements/req-001_dashboard-administrator-authentication.md",
"baseline_id": "REQ-001.01-REQ-001.11",
"semantic_key": "dashboard_auth_gate_cookie_cleanup_logout_and_rotation",
"meaning": "REQ-001 authentication remains fail-closed before DB/page dispatch, with server-only credential binding, hardened persistent cookie, absolute TTL, invalid-cookie cleanup, explicit logout, rotation invalidation, and no DB-backed session.",
"reviewed_ids": [
"REQ-001.01",
"REQ-001.05",
"REQ-001.06",
"REQ-001.07",
"REQ-001.08",
"REQ-001.09",
"REQ-001.10"
],
"reviewed_status": "unchanged_from_baseline",
"planned_ids": [
"N01"
],
"planned_status": "must_remain_unchanged",
"authorization": "Issue #12 rework is additive and cannot modify authentication semantics or claim MCP authentication.",
"evidence_paths": [
"docs/requirements/req-001_dashboard-administrator-authentication.md",
"docs/interface-contract.md",
"dashboard/authentication.py",
"dashboard/auth_server.py",
"tests/test_dashboard_authentication.py",
"tests/test_dashboard_persistent_authentication.py",
"tests/test_dashboard_auth_server.py",
"tests/test_dashboard_authentication_app.py"
],
"verification": "Git diff confirms REQ-001 file has no changes between baseline and reviewed head."
},
{
"path": "docs/requirements/req-002_dashboard-menu-transition.md",
"baseline_id": "REQ-002.01-REQ-002.09",
"semantic_key": "dashboard_menu_identity_query_and_stable_shell",
"meaning": "The exact ten menu labels/order, selected state, page-only query update with sibling preservation, stable shell/background, local loading/error/retry, latest serialized selection, auth gate, finance pages, and clear_cache contract remain unchanged.",
"reviewed_ids": [
"REQ-002.01",
"REQ-002.02",
"REQ-002.03",
"REQ-002.04",
"REQ-002.05",
"REQ-002.06",
"REQ-002.07",
"REQ-002.08",
"REQ-002.09"
],
"reviewed_status": "unchanged_from_baseline",
"planned_ids": [
"N01"
],
"planned_status": "must_remain_unchanged",
"authorization": "Issue #12 rework may add valuation content behind existing pages but may not alter menu identity, query semantics, shell continuity, or browser evidence requirements.",
"evidence_paths": [
"docs/requirements/req-002_dashboard-menu-transition.md",
"docs/interface-contract.md",
"dashboard/app.py",
"dashboard/common.py",
"tests/test_dashboard_menu_transition.py",
"tests/test_dashboard_app.py",
"tests/test_dashboard_authentication_app.py",
"docs/evidence/issue-9-dashboard-menu-transition/"
],
"verification": "Git diff confirms REQ-002 file has no changes between baseline and reviewed head."
},
{
"path": "docs/interface-contract.md",
"baseline_id": "COMMON-IFACE-01",
"semantic_key": "success_error_envelope_and_public_service_signatures",
"meaning": "Existing success/error envelopes remain; valuation, snapshot, MCP, Dashboard gateway, and service signatures are additive and re-exported through the established service boundary.",
"reviewed_ids": [
"COMMON-IFACE-01"
],
"reviewed_status": "preserved_with_additive_REQ003_contract",
"planned_ids": [
"D04"
],
"planned_status": "strengthen_exact_output_and_replay_contract; semantics_unchanged",
"authorization": "No existing response key may be renamed or removed.",
"evidence_paths": [
"docs/interface-contract.md",
"jarca_ledger_mcp/service.py",
"jarca_ledger_mcp/adapters/mcp/server.py",
"tests/test_contract_regression.py"
],
"verification": "Reviewed contract explicitly lists signatures, envelopes, top-level aliases, nested provenance, and replay rules."
},
{
"path": "docs/data-model.md",
"baseline_id": "COMMON-DATA-01",
"semantic_key": "legacy_entities_and_storage_ownership",
"meaning": "Existing ledger entities and relationships remain; valuation and snapshot history are append-only; monthly alias is not a persistence field; application services own policy and SQLite owns storage.",
"reviewed_ids": [
"COMMON-DATA-01"
],
"reviewed_status": "preserved_with_additive_REQ003_model",
"planned_ids": [
"N02",
"D03"
],
"planned_status": "strengthen_physical_field_and_ownership_checks; semantics_unchanged",
"authorization": "No guessed migration, cascade deletion, fake transaction, or alternate policy boundary is authorized.",
"evidence_paths": [
"docs/data-model.md",
"jarca_ledger_mcp/infrastructure/sqlite/schema.py",
"jarca_ledger_mcp/application/assets_service.py",
"jarca_ledger_mcp/application/reconciliation_service.py"
],
"verification": "Data model names legacy preservation, append-only relationships, physical fields, and canonical owners."
},
{
"path": "docs/runtime-flow.md",
"baseline_id": "COMMON-RUNTIME-01",
"semantic_key": "auth_before_db_and_explicit_write_boundaries",
"meaning": "Dashboard auth precedes DB access; read/preview paths are read-only; first-use writer initialization is explicit; approval precedes atomic close; downstream reports are reads.",
"reviewed_ids": [
"COMMON-RUNTIME-01"
],
"reviewed_status": "preserved_with_additive_REQ003_flow",
"planned_ids": [
"N01",
"D03",
"D04"
],
"planned_status": "strengthen_transition_guards_and_drift_revalidation; semantics_unchanged",
"authorization": "Preserve ordering, transaction boundaries, stable missing-DB behavior, and no implicit writes.",
"evidence_paths": [
"docs/runtime-flow.md",
"dashboard/app.py",
"jarca_ledger_mcp/infrastructure/sqlite/connection.py",
"jarca_ledger_mcp/application/assets_service.py",
"tests/test_issue_12_review59_readonly.py"
],
"verification": "Runtime flow explicitly records auth-before-DB, read-only database lifecycle, preview drift revalidation, and atomic close."
},
{
"path": "docs/project-structure.md",
"baseline_id": "COMMON-STRUCTURE-01",
"semantic_key": "canonical_module_ownership_and_regression_map",
"meaning": "Valuation/snapshot policy remains in application services; adapters remain thin; Dashboard pages do not own SQL or policy; named tests and documentation validators are required evidence.",
"reviewed_ids": [
"COMMON-STRUCTURE-01"
],
"reviewed_status": "preserved_with_REQ003_ownership_map",
"planned_ids": [
"N01",
"C06"
],
"planned_status": "strengthen ownership and named-test traceability; semantics_unchanged",
"authorization": "Rework must preserve canonical owners and may not introduce duplicate business logic in adapters.",
"evidence_paths": [
"docs/project-structure.md",
"jarca_ledger_mcp/application/account_valuation_service.py",
"jarca_ledger_mcp/application/assets_service.py",
"jarca_ledger_mcp/application/monthly_settlement_service.py",
"jarca_ledger_mcp/infrastructure/sqlite/connection.py",
"tests/test_requirement_docs.py"
],
"verification": "Reviewed structure document contains explicit ownership, dependency, preservation, and named regression-test sections."
}
],
"missing_count": 0,
"ambiguous_count": 0,
"notes": [
"REQ-001 and REQ-002 requirement files are byte-for-byte unchanged from baseline; common docs were extended additively for REQ-003.",
"Source contract digest supplied by the caller is 6d86b591b022fcc722611bfec6d24e54a64216ab6f7c4098f357e25420218818.",
"The checked-out repository does not define a canonical glossary mapping finding labels N01, C05, C06, N02, D03, and D04 to independent issue descriptions; planned mappings above are therefore preservation-oriented semantic associations inferred from the reviewed contract text.",
"No files were created or modified; no commit, push, fetch, or Gitea call was performed.",
"Main-agent resolution: Review #60 body is the authoritative glossary for N01/C05/C06/N02/D03/D04; each label and prose was read from admission-snapshot.json, so the delegate-reported label-mapping ambiguity is resolved without changing contract meaning."
],
"schema": "gitea-agent.contract-preservation-inventory/v1"
}