{
  "revision": "314549990ee631ed20ff7786b71b973c20eae03b",
  "revision_note": "Local working tree based on 314549990. QA found and corrected the inventory-amendment unit display. Counts below are separate runs and overlap.",
  "runs": [
    {
      "name": "Refreshed captures and current editor",
      "status": "passed",
      "result": "111 tests, 905 assertions; no failures or errors. Includes all eight browser scenarios and 103 raw-material controller checks. All 45 captures are current.",
      "command": "mise exec ruby@3.2.8 -- env BK_TEST_DATABASE=agent PARALLEL_WORKERS=1 BK_STORYBOARD_OUTPUT=/Users/paul/src/kbc/brewkeeper/docs/reports/brewing-units-2026-11-08 bin/rails test test/system/production/brewing_units_storyboard_test.rb test/controllers/production/raw_materials_controller_test.rb",
      "log": "logs/refresh-tests.log"
    },
    {
      "name": "Browser acceptance and related regressions",
      "status": "passed",
      "result": "41 tests, 579 assertions; no failures or errors. Eight storyboard scenarios produce 44 captures, including Saved/Reset and click-to-select.",
      "command": "mise exec ruby@3.2.8 -- env BK_TEST_DATABASE=agent PARALLEL_WORKERS=1 BK_STORYBOARD_OUTPUT=/Users/paul/src/kbc/brewkeeper/docs/reports/brewing-units-2026-11-08 bin/rails test test/system/production/brewing_units_storyboard_test.rb test/system/production/brewing_units_test.rb test/system/production/raw_material_lot_panel_test.rb test/system/production/japanese_units_test.rb test/system/purchasing/custom_unit_equivalents_test.rb",
      "log": "logs/browser.log"
    },
    {
      "name": "Final full Minitest suite",
      "status": "passed",
      "result": "5,997 tests, 37,756 assertions; no failures or errors, 36 skips.",
      "command": "bin/rails-test-agent test",
      "log": "logs/full-suite.log"
    },
    {
      "name": "Latest raw-material editor and reference links",
      "status": "passed",
      "result": "103 tests, 707 assertions; no failures or errors. Rerun after two late template/controller-test edits.",
      "command": "bin/rails-test-agent test test/controllers/production/raw_materials_controller_test.rb",
      "log": "logs/current-editor-controller.log"
    },
    {
      "name": "Model, service, controller and component checks",
      "status": "passed",
      "result": "327 tests, 2,066 assertions; no failures or errors.",
      "command": "bin/rails-test-agent test test/models/product_brewing_units_test.rb test/services/production_brewing_units_test.rb test/services/yeast_service_test.rb test/controllers/production/raw_materials_controller_test.rb test/models/production/material_resource_plan_test.rb test/models/production/reports/recipe_submission_test.rb test/models/production/reports/production_ledger_test.rb test/models/production/reports/batch_turn_material_totals_test.rb test/controllers/production/inventory_amendments_controller_test.rb test/controllers/production/recipes/costing_controller_test.rb test/components/production/brewing_amount_component_test.rb test/components/units_component_test.rb test/models/warehouse/lot_inventory_location_test.rb",
      "log": "logs/focused.log"
    },
    {
      "name": "Post-fix amendment checks",
      "status": "passed",
      "result": "33 tests, 211 assertions; no failures or errors. New volume-source regression failed before the fix; existing mass source units remain unchanged.",
      "command": "bin/rails-test-agent test test/services/production_brewing_units_test.rb test/controllers/production/inventory_amendments_controller_test.rb",
      "log": "logs/amendment-after.log"
    },
    {
      "name": "Shared RSpec suite",
      "status": "passed",
      "result": "103 examples, no failures, 2 pending.",
      "command": "BK_TEST_DATABASE=agent mise exec ruby@3.2.8 -- bundle exec rspec",
      "log": "logs/rspec.log"
    },
    {
      "name": "JavaScript controller checks",
      "status": "passed",
      "result": "14 tests; all passed.",
      "command": "node --test test/javascript/units_component_test.mjs test/javascript/production_brewing_amount_test.mjs test/javascript/product_select_test.mjs",
      "log": "logs/javascript.log"
    },
    {
      "name": "Conversion-basis migration and database constraints",
      "status": "passed",
      "result": "3 tests, 16 assertions; no failures or errors.",
      "command": "bin/rails-test-agent test test/migrations/store_brewing_conversion_basis_test.rb",
      "log": "logs/migration.log"
    },
    {
      "name": "JavaScript build",
      "status": "passed",
      "result": "esbuild completed successfully before browser testing.",
      "command": "mise exec ruby@3.2.8 -- yarn build",
      "log": "logs/build.log"
    },
    {
      "name": "Storyboard browser verification",
      "status": "passed",
      "result": "45 images decoded; chapter filtering, enlargement and keyboard navigation passed. No horizontal overflow at desktop or 500 px.",
      "command": "mise exec ruby@3.2.8 -- bundle exec ruby docs/reports/brewing-units-2026-11-08/verify_gallery.rb",
      "log": "logs/gallery-qa.log"
    },
    {
      "name": "RuboCop on the changed presenter",
      "status": "baseline",
      "result": "Three existing heredoc indentation offences on untouched lines 119, 128 and 140. No offences in the changed method.",
      "command": "mise exec ruby@3.2.8 -- bundle exec ruby -rrubocop -e 'exit RuboCop::CLI.new.run(ARGV)' -- --cache false app/presenters/production/inventory_amendment_item.rb --format simple",
      "log": "logs/amendment-lint.log"
    }
  ],
  "edge_cases": [
    [
      "Purchasing fallback",
      "Blank brewing settings keep purchasing units; turning volume brewing off clears factor and basis.",
      "Frames 01, 07; product model tests"
    ],
    [
      "Default factor and unit",
      "Enabling volume brewing starts at 1 kg/L. mL is selectable through the shared unit component.",
      "Frames 02\u201304; browser tests"
    ],
    [
      "Decimal precision",
      "1.037123456789 kg/L is stored and reloaded exactly.",
      "Frame 03; product and migration tests"
    ],
    [
      "Two explicit bases",
      "kg/L multiplies volume to mass; L/kg divides. No reciprocal input is saved.",
      "Frames 03, 04, 53, 61; JavaScript and product tests"
    ],
    [
      "Zero, negative and non-finite factors",
      "Reject zero, negative, NaN and infinity; preserve the last valid product.",
      "Frame 06; product and migration tests"
    ],
    [
      "Partial settings and unsupported categories",
      "Reject partial pairs, mismatched units and unsupported directions. Volume-purchased material cannot enable the mass/volume toggle.",
      "Frame 09; product and database tests"
    ],
    [
      "Existing recipes",
      "Keep saved kg amounts until the user explicitly converts and saves. Copying also preserves original amounts.",
      "Frames 30\u201332; service and browser tests"
    ],
    [
      "Independent added rows and product changes",
      "New rows apply the chosen product default, including switches within one category; saved reload retains units.",
      "BrewingUnitsTest; JavaScript tests"
    ],
    [
      "Planning-only references",
      "Recipe and pending batch-linked schedule references warn but permit a valid correction.",
      "Frames 13, 15; service tests"
    ],
    [
      "Projected inventory",
      "Changing 0.8 to 1 L/kg recalculates projected stock from 1.375 to 1.5 kg without changing actual stock.",
      "Frames 14\u201316; MRP tests"
    ],
    [
      "Insufficient and combined demand",
      "Reject 2,000 mL against 1,600 mL available. Two rows cannot independently spend the same mass stock.",
      "Frame 17a; production service test"
    ],
    [
      "Stale form",
      "Execution reloads a conversion changed after the form was opened; stock and cost use the current valid rate.",
      "ProductionBrewingUnitsTest"
    ],
    [
      "Brewhouse depletion and cost",
      "500 mL at 0.8 L/kg removes 625,000 mg and uses the mass lot cost.",
      "Frames 12, 17\u201318; costing and service tests"
    ],
    [
      "Fermenter and bright tank",
      "Browser saves in both phases keep mL doses and deplete kg stock.",
      "Frames 40\u201344; stock and completed-task assertions"
    ],
    [
      "Brink execution",
      "The browser records a 500 mL nutrient addition, removes 0.625 kg and keeps yeast volume at 20 L.",
      "Frames 50\u201352; yeast service tests"
    ],
    [
      "Purchased yeast",
      "Staged pitch does not lock conversion. Knockout consumes 0.625 kg for 500 mL, then locks it.",
      "Frames 53\u201354"
    ],
    [
      "Substitution density",
      "Use the substitute factor, 1.5 kg/L; 500 mL removes 0.75 kg. Original stock stays untouched.",
      "Frames 61\u201362"
    ],
    [
      "Untracked use",
      "No physical stock movement, but actual untracked usage locks conversion.",
      "Frame 60; service tests"
    ],
    [
      "Actual-use and source protection",
      "Lock factor, basis and source measurement after use. A different default within volume remains permitted.",
      "Frames 19\u201320; product, controller and service tests"
    ],
    [
      "Amendment and undo",
      "A 0.5 kg correction changes the source to 400 mL. Undo restores stock but historical use keeps conversion locked.",
      "Frames 21\u201323; amendment controller and service tests"
    ],
    [
      "Reports and category selection",
      "Costing, recipe-submission projections, actual totals and ledger use inventory equivalents; volume report categories remain supported.",
      "Frames 11\u201312, 24; report tests"
    ],
    [
      "Optional conversion flag",
      "Disabling volumetric conversion still performs standard internal-unit scaling and does not require a factor.",
      "Product conversion tests"
    ],
    [
      "Japanese and narrow layout",
      "Translated labels retain canonical units after selection, save and navigation. Configuration is usable at 500 px.",
      "Frames 05, 08; JapaneseUnitsTest; JavaScript tests"
    ],
    [
      "Purchasing and stock regressions",
      "Custom purchasing-unit equivalents, lot editing, receipt/deletion behaviour and stock panels retain their existing units.",
      "CustomUnitEquivalentsTest; RawMaterialLotPanelTest"
    ],
    [
      "Migration upgrade and rollback",
      "Upgrade copies old L/kg values without reciprocals; rollback preserves those values and converts terminating density reciprocals.",
      "StoreBrewingConversionBasisTest"
    ],
    [
      "Saved conversion, Reset and click-to-select",
      "Typing after a click replaces the whole factor. The saved pair remains visible and Reset restores it without a database write.",
      "Frame 03a; browser acceptance assertions"
    ],
    [
      "Recorded-use navigation",
      "The lock links to recorded batch use inside the material panel; the heading and warehouse stock remain unchanged.",
      "Frame 19a; refreshed browser and controller checks"
    ]
  ],
  "baseline_failures": [
    "SquareOrderSynchronisationTest#test_all_active_locations_import_without_inventory_enrolment_and_new_locations_receive_full_history",
    "SquareOutstandingOrdersTest#test_healthy_open_draft_and_completed_orders_rely_on_incremental_polling",
    "SquareOutstandingOrdersTest#test_local_inventory_repairs_recover_unresolved_facts_without_another_Square_revision",
    "SquareSalesBatchesTest#test_catalogue_failures_are_retried_within_a_batch_without_caching_unavailable_classification",
    "SquareSalesBatchesTest#test_catalogue_object_reads_are_shared_across_orders_and_variants_but_separated_by_version_and_batch",
    "SquareSalesBatchesTest#test_failed_later_pages_keep_their_cursor_and_retry_without_duplicating_inventory_or_audit_effects",
    "SquareSalesBatchesTest#test_repeated_cursors_across_job_boundaries_fail_before_acknowledging_another_page",
    "SquareSalesBatchesTest#test_restarts_resume_acknowledged_pages_and_completed_locations_during_a_capture_upgrade",
    "SquareSalesBatchesTest#test_sales_jobs_yield_between_pages_and_automatically_queue_their_continuation",
    "SquareSalesCaptureTest#test_measured_and_ad_hoc_lines_retain_exact_sales_quantities_and_have_stable_shop_identities",
    "SquareSalesRefreshJobTest#test_recovery_enqueues_lost_sales_jobs_and_revocation_works_without_new_scopes",
    "TranslationSuggestionServiceTest#test_missing_configuration_and_missing_Discord_acknowledgement_are_failures",
    "TranslationSuggestionServiceTest#test_posts_one_structured_suggestion_with_source_page,_locale_and_attribution",
    "TranslationSuggestionServiceTest#test_transport_errors_do_not_report_success_or_discard_the_suggestion"
  ],
  "baseline_exact_match": true,
  "screenshots": 45,
  "observations": [
    "A long density decimal can be visually clipped by the narrow number field. The full value remains editable and its exact save/reload is asserted."
  ],
  "scope": "Fictional transactional fixtures in barcodes_test_agent and worker databases; no development or production customer writes.",
  "qa_fix": {
    "file": "app/presenters/production/inventory_amendment_item.rb",
    "problem": "An internal mass movement was displayed and edited using the source brewing-volume unit: 625,000 mL instead of 0.625 kg.",
    "change": "Retain source units only within the inventory measurement category; otherwise use the purchasing default. Same-category gram sources retain grams.",
    "proof": "The new regression failed before the fix. The focused post-fix run passed 33 tests and 211 assertions. Browser coverage now submits a 0.5 kg correction and asserts 400 mL and 1.5 kg stock.",
    "before_image": "findings/amendment-before.png"
  },
  "browser_test_isolation": "Desktop tests now set their viewport. Raw-material checks use the current default Details view without opening it twice. The movement-filter test clears the previous tab's retained lot selection before expecting both lots. These changes remove test-state/navigation failures without changing application behaviour.",
  "source_changes_during_final_full_suite": [
    "app/views/production/raw_materials/_brewing_units.html.erb",
    "test/controllers/production/raw_materials_controller_test.rb"
  ],
  "final_full_suite_passed": true,
  "suite_note": "The final full Minitest suite passed: 5,997 tests, 37,756 assertions, no failures or errors, 36 skips. The initial run had 14 matching baseline failures; these no longer occur after the concurrent working-tree updates. The final browser run also passed all 41 checks after correcting navigation, viewport and retained-filter assumptions in the tests.",
  "initial_full_suite_result": {
    "tests": 5990,
    "assertions": 37641,
    "failures": 9,
    "errors": 5,
    "skips": 36,
    "baseline_exact_match": true,
    "log": "logs/full-suite-initial.log"
  },
  "source_note": "Two reference-link/template edits landed during the original full-suite run. The refreshed pass now exercises the current editor, recorded-use navigation and every storyboard scenario: 111 tests and 905 assertions passed. The original full-suite results remain recorded separately below.",
  "refreshed_at": "2026-11-08T03:47:40+00:00",
  "refresh_note": "Refreshed 2026-11-08T03:47:40+00:00: all existing screens were recaptured from the current local application. A new recorded-use screen shows batch history opening inside the material panel while retaining its heading.",
  "publication": {
    "bucket": "brewkeeper-files",
    "region": "us-west-2",
    "prefix": "reports/brewkeeper/brewing-units-2026-11-08",
    "url": "https://brewkeeper-files.s3.us-west-2.amazonaws.com/reports/brewkeeper/brewing-units-2026-11-08/index.html"
  }
}