Files
compras/docs/proofs/audit-export-scope-proposal.json
T
nala 448948a487
tests / ci (push) Waiting to run
commit compras1 2911
2026-11-29 05:28:30 +02:00

270 lines
16 KiB
JSON

{
"date": "2026-11-27",
"status": "implemented_in_qa_functional_and_bounded_native_visual_verification_passed_operational_activation_pending",
"owner_private_family_decision_20261128": {
"exact_reply": "Compras, stock, finanças e configuração; bancos completos e Pessoas ficam separados",
"included": [
"purchasing",
"stock",
"finance",
"configuration"
],
"not_included": [
"complete_bank_identifiers",
"private_people_data_and_documents"
],
"effect": "Implement the dedicated private audit export for the four included families in QA. Complete bank identifiers stay masked/excluded; People private data/documents are outside this scope. No actual grants, operational export, installation or activation. Do not ask this scope again."
},
"owner_decision_20261128": {
"selected_choice": "dedicated_audit_scope",
"exact_reply": "Autoridade de auditoria própria para consultar conteúdo privado adicional",
"effect": "Implement a separate configurable audit authority; the existing metadata permission remains unchanged. No real user/profile grant, pilot installation or private data export is authorised by development.",
"remaining_configuration": "Private source families and designated audit profiles must be explicit in the company configuration; no implicit Admin/Finance/private-bank/personnel access."
},
"purpose": "Define the intended private-content scope of the matrix's integral audit export before extending a permission explicitly limited to metadata.",
"available_audits_explained_20261128": {
"current_event_audit": "Implemented: company event ID/date/action/actor ID, filters and complete CSV; includes events from purchasing, stock, People and configuration, but no private before/after payload or document bytes.",
"current_process_evidence": "Implemented through native process permissions: request history and cycles, frozen rules, decisions, quotations/evaluations, orders and linked documents. This is not a separate private auditor authority.",
"current_reconciliation_reports": "Implemented native operational/financial reports for purchasing, receipt/stock, budgets, invoices, confirmed external payments and explicit category attribution. No bank transfer execution or external audit certification is implied.",
"new_private_export": "Implemented in isolated synthetic QA for the four owner-selected families. Dedicated configurable per-family authority; no actual operational grants or activation."
},
"concrete_private_family_options_20261128": {
"base_purchasing_stock_finance_configuration": {
"purchasing": "Original/versioned requests, approval cycles and rules, production/maintenance origins, quotations, evaluations, awards, orders and authorised original documents.",
"stock": "Receipts, quantities, lots, quality, reservations, deliveries, returns and reversals with their native source links.",
"finance": "Budget allocations/reservations/commitments/consumption, invoices, outstanding amounts, confirmed external payments and explicit category allocations; bank identifiers remain masked unless the separate bank family is approved.",
"configuration": "Versioned business rules, profiles, memberships, delegations and recorded changes; passwords, tokens and secrets are excluded."
},
"optional_bank_identifiers": "Complete supplier bank identifiers and their independent verification history, as a separately configurable audit family.",
"optional_people_documents": "Private data and originals of the existing People/candidate/selection processes in their own work context. Does not invent formal employment contracts, payroll or the deferred formalisation workflow.",
"common_limits": "Company-configurable, separate audit permissions; no automatic Admin/Finance grant or operational installation. QA implementation/tests only, with synthetic data. Each included file is checked and covered by the export manifest; no blind AuditLog before/after dump."
},
"existing_authority": {
"permission": "audit_metadata_read",
"declared_scope": "Company-wide event ID, recorded date, action and user ID; no private payloads",
"source": "app/Services/OrganizationAccess.php and docs/auditoria-metadados.md",
"implemented": "Filtered full metadata CSV and independently authorised links to native processes. Existing native process/document permissions remain separate."
},
"choices": {
"native_scope": {
"description": "Export all process data and originals that this user can already consult through the native modules, together with authorised audit metadata.",
"authority": "Revalidate current identity, company, work context and each native process/document reader; audit_metadata_read alone never authorises a private item.",
"contents": "Original/versioned request and approval evidence, applicable frozen rules, native order/receipt/invoice/payment or People records and private originals only where their current native readers permit them. Preserve each module's field-level restrictions and separate work contexts. Never blindly serialise arbitrary AuditLog before/after payloads.",
"coverage": "Manifest distinguishes included sources and unavailable/restricted source families without revealing hidden record identities or counts. Unknown historical fields stay unknown; no reconstruction from current rules."
},
"dedicated_audit_scope": {
"description": "Create a distinct company-configurable audit authority to read/export private content beyond the user's ordinary process access.",
"authority": "Requires the owner to define included modules/private data and explicitly designated audit profiles. It is not implied by Admin or the existing metadata permission. No actual grant would be created by development or this choice.",
"contents": "Only the private families explicitly defined by the owner; bank identifiers, personnel records and originals must be identified within that definition rather than inferred."
},
"metadata_only": {
"description": "The required integral export is all authorised event metadata, not a private-content dossier.",
"effect": "Retain the demonstrated full filtered metadata export and native process links; remove the unrequested private-export obligation from the existing matrix without relabelling metadata as a private payload export."
}
},
"common_implementation_requirements": [
"Private downloadable artifact with versioned coverage manifest, collection time and verified hashes for included original bytes; no publication or external transmission",
"Original data, approvals, versions and native audit remain unchanged; no payment, stock or financial effects",
"Current authorisation checked at generation/download, company/work-context isolation, maintenance and revoked/expired grants refused",
"QA validation with synthetic data: allowed/restricted sources, missing or altered originals, all-page completeness, stable evidence, failure/cleanup and no duplicate business effects",
"No claim of legal certification, absolute SQL-administrator protection or a new retention period; the existing indefinite preservation decision remains"
],
"not_authorised_by_this_definition": [
"Operational grants or role changes, pilot/SGF installation, migration or activation",
"Bypassing a native reader, broadening metadata authority silently or exporting real private data",
"Automatic disclosure, email, publication, destructive source cleanup or changing the two products' independence"
],
"existing_pilot_access_proposal": "audit-access-proposal.json remains a separate unapplied grant proposal; this scope question does not replace or approve it.",
"implementation_qa_20261128": {
"authority": "Four independent explicit private audit permissions; no Admin, Finance or metadata fallback; current actor, tenant, work context, expiry and maintenance revalidated.",
"source_contract": "109 fixed allowlisted tables plus curated events and explicit SupplyRecord kinds; standalone financial rows scoped to tenant/company0/unit0. Optional absent sources explicitly not_installed, records null; legacy missing columns identified. No new balance calculations.",
"package": "Immutable private ZIP and manifest; NDJSON all-page stable source snapshot; original source hashes verified; SHA256 and exact size; operation UUID bound to actor/context/scope/purpose; replay preserved; partial owned files cleaned individually.",
"excluded": [
"complete bank registers and structured bank coordinates",
"bank-specific import originals",
"private People data and originals",
"credentials",
"arbitrary event payloads",
"native storage paths"
],
"original_semantics": "Ordinary authorised business originals retain exact bytes; no claim to redact arbitrary free text or certify documents.",
"sqlite": {
"tests": 15,
"passed": 15,
"assertions": 493
},
"postgresql": {
"tests": 16,
"passed": 16,
"assertions": 498,
"database": "compras_receipts_test_de3f9447a4ff",
"removed": true
},
"frontend": {
"tests": 24,
"files": 2,
"passed": 24
},
"native_http": {
"checks": 270,
"fortify_sessions": 4,
"readonly_tables_equal": 138,
"verified_assets": 20,
"audit_export_posts_including_replay": 2,
"business_commands": 0,
"zip_download_sha256_verified": true,
"isolated_database_and_role_removed": true
},
"static": "PHPStan zero errors; types, targeted frontend check, Pint and private build passed. Final Files parent containment hardening followed by SQLite13/482 and PHPStan0.",
"build": {
"path": "storage/framework/testing/sgc-private-audit-help-qa-20261128",
"manifest_sha256": "fa87e37a3626ef75d22b5248dce9a0af2bad68c967e6f99bb64bc426a68f6aaf",
"entries": 183,
"missing_files_or_imports": 0
},
"limits": "QA only; no pilot migration, actual grants, activation or SGF writes. Bounded native desktop/mobile generation and download now demonstrated; full application and physical print acceptance remain open. People formalisation remains deferred.",
"help_delta": {
"frontend_tests": 10,
"files": 2,
"all_operational_pages_have_specific_help": true,
"pages": [
"audit/private",
"requisitions/operational-orders",
"requisitions/urgent-stock"
],
"types_and_targeted_check": "passed"
},
"corrections_and_regressions": [
"Import document metadata kind added to the allowlist; ordinary documentary versions preserved, typed banking documents still excluded.",
"SupplyRecord JSON explicitly decoded on SQLite as well as PostgreSQL before recursive redaction; nested native paths cannot escape as raw JSON strings.",
"Same-company fully authorised auditors cannot read another creator package.",
"Output parent components reject symlinks and must remain within the owned private QA storage."
],
"pilot_manifest_sha256": "1edb9ab0aa62fcf4e9c9075ce6e405de5435dc8ea4799d1949535a96c718df4e",
"private_archive_recovery_delta": {
"sqlite_tests": 6,
"assertions": 438,
"passed": 6,
"missing_archive_detected": true,
"no_silent_regeneration": true,
"exact_bytes_restored_from_separate_private_fake_disk": true,
"metadata_and_audit_unchanged": true,
"not_a_full_sql_file_restore": true
}
},
"native_visual_delta_20261128": {
"date": "2026-11-28",
"environment": "same owned isolated QA",
"native_fortify_login": true,
"profile": "synthetic dedicated private auditor",
"families": [
"purchases",
"stock",
"finance",
"configuration"
],
"default_selection_empty": true,
"explicit_purpose_and_selection_required": true,
"package_id": 1,
"bytes": 998596,
"displayed_sha256": "aaa18e0f58252b5262430408763e41c5d7502865b6f1186b249c74be09bf2e14",
"native_download_completed_filename": "auditoria-1.zip",
"physical_download_path_inspected": false,
"mobile_viewport": {
"width": 390,
"height": 526
},
"hash_wrapped_and_download_visible": true,
"mobile_menu_export_entry_visible": true,
"metadata_authority_not_inferred": true,
"successful_form_reset": true,
"full_application_acceptance": false,
"qa_database_and_role_removed": true,
"original_user_tab_preserved": true
},
"sql_and_private_files_recovery_delta_20261128": {
"command": "node scripts/requisition-ledger-qa-check.mjs --private-audit-recovery --integrated-schema --frozen-runtime",
"source_database": "compras_receipts_test_77d3a97ec523",
"restored_database": "compras_receipts_test_a546c3b9d7b8",
"separate_non_privileged_restore_identity": true,
"tables_columns_and_rows_equal": 138,
"four_family_archive_bytes_and_sha256_preserved": true,
"synthetic_original_and_archived_copy_preserved": true,
"idempotent_replay_without_effects": true,
"current_revocation_refused": true,
"source_file_tree_renamed_unavailable_during_verification": true,
"restored_files_copied_from_separate_backup_tree": true,
"all_databases_roles_cluster_and_owned_root_removed": true,
"syntax_pint_node_check_diff_passed": true,
"operational_changes": false,
"limits": "Synthetic QA only; does not certify a production backup schedule, recovery SLA or actual operational installation."
},
"supplier_event_history_delta_20261129": {
"status": "Implemented and verified in isolated synthetic QA",
"problem": "Purchasing export included supplier records but omitted their own audit event history.",
"change": "Include supplier evaluation, improvement and response event families and the five explicit supplier registration/document actions. Keep bank events, unknown future supplier actions, other families and other companies excluded. Preserve metadata-only event projection.",
"verification": {
"sqlite_initial_suite": {
"tests": 17,
"assertions": 536
},
"sqlite_final_zip_delta": {
"tests": 1,
"assertions": 415
},
"postgresql_final_complete_suite": {
"tests": 17,
"assertions": 542
},
"zip": "Generated four-family archive contains all three supplier follow-up events; bank event/private payload absent; manifest hashes/counts verified and idempotence preserved.",
"phpstan_errors": 0,
"pint": "passed",
"node_syntax": "passed",
"first_fixture_failures": "Foreign synthetic event initially lacked required user_id, then after payload; fixture corrected with its own company actor and explicit synthetic payload. No production constraint changes.",
"counts_overlap": true,
"isolated_database_removed": true,
"isolated_role_removed": true
},
"operational_changes": false,
"remaining": "No new native download review for this event-only correction; no full application acceptance."
},
"planning_cancellation_stock_events_delta_20261129": {
"status": "Implemented and verified in isolated synthetic QA",
"problem": "Exported planning, cancellation and warehouse return records had no corresponding event history in their own audit family.",
"change": {
"purchasing": [
"planning.",
"purchase_control.",
"cancellation.",
"order_cancellation.",
"order_cancellation_policy."
],
"stock": [
"warehouse_return."
]
},
"verification": {
"sqlite_suite_before_final_zip_assertions": {
"tests": 18,
"assertions": 558
},
"sqlite_final_zip_delta": {
"tests": 1,
"assertions": 421
},
"postgresql_final_complete_suite": {
"tests": 18,
"assertions": 564
},
"zip": "Verified purchasing planning/cancellation events and stock warehouse-return event in separate NDJSON files, with no cross-family contamination. Every included dataset manifest hash/count checked.",
"phpstan_errors": 0,
"pint": "passed",
"counts_overlap": true,
"isolated_database_removed": true,
"isolated_role_removed": true
},
"operational_changes": false,
"remaining": "No new native visual/download review; whole application acceptance remains open."
}
}