Repository navigation
Commit 4cbc9e1
fix(artifact): stamp the clean-basis trust check the way the rows were written
The reconcile_basis marker was never written on Windows, so all six
build_trusted_artifact_repo() tests plus artifact_export_marks_clean_basis
failed there (16 passed, 7 failed) while every Linux and macOS leg was green.
Root cause is a stamp-encoding mismatch, not shell quoting. file_hashes rows
are stamped by the semantic manifest via cbm_path_info_utf8(), which on Windows
derives mtime_ns from ftLastWriteTime -- 100-nanosecond FILETIME ticks.
db_hashes_match_disk() re-stat()ed those same files through _wstat64, whose
st_mtime carries WHOLE SECONDS, and compared the two. The values can only agree
when a file's write time lands exactly on a second boundary, so the trust check
rejected the very first row on every export, on Windows and only on Windows.
On POSIX both paths read st_mtim nanoseconds and agree, which is why the split
was clean along platform lines.
The disk side now reads through cbm_path_info_utf8 -- the same function that
wrote the rows -- so there is no encoding left to keep in sync. Its
is_regular/is_symlink guard preserves exactly the symlink refusal
reconcile_stat_no_symlink provided.
reconcile_restamp_rows deliberately keeps art_stat_mtime_ns: a restamped row is
read by the incremental classifier and by check_index_coverage, both of which
stat() and encode whole seconds on Windows. The asymmetry is now pinned with a
comment at both sites so neither is "unified" into breaking the other.
Diagnostics, which is why this took two wrong diagnoses to find:
- Export's four clean-basis preconditions were one short-circuiting && chain
collapsing to a single bool. They are now evaluated by reconcile_basis_trusted,
which records the first failing gate (head_unresolved / head_not_hex_oid /
tree_not_clean / db_hashes_differ_from_disk, the last carrying the offending
path and BOTH stamps) and logs it as artifact.reconcile_basis_omitted. The
reason is recorded rather than recomputed on demand: export's own
ensure_gitattributes leaves an untracked .gitattributes behind, so any later
evaluation answers tree_not_clean whatever the real cause was.
- build_trusted_artifact_repo() had six `return NULL` exits and reported none of
them; CI could not tell a failed `git commit` from a missing marker. Every exit
now names its step and carries the number that decided it -- git exit status,
pipeline rc, or export's recorded blocker -- surfaced through
BUILD_TRUSTED_REPO_OR_FAIL at the call site so file:line still points at the
failing test.
Verified locally on macOS by emulating the Windows encoding: truncating the
disk-side mtime to whole seconds reproduces the CI signature exactly (16 passed,
7 failed, same seven sites), and the new diagnostic names it as
`db_hashes_differ_from_disk path=a.rs reason=mtime_differs stored_mtime_ns=...
disk_mtime_ns=...`. Restored, the artifact/pipeline/incremental/mcp/index_format/
daemon_bootstrap suites are green and make lint-ci passes.
Co-authored-by: moofone <35233167+moofone@users.noreply.github.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent a9d635f commit 4cbc9e1
3 files changed
Lines changed: 212 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
| |||
517 | 529 | | |
518 | 530 | | |
519 | 531 | | |
520 | | - | |
521 | | - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
522 | 553 | | |
523 | 554 | | |
524 | 555 | | |
| |||
527 | 558 | | |
528 | 559 | | |
529 | 560 | | |
| 561 | + | |
530 | 562 | | |
531 | 563 | | |
532 | 564 | | |
| 565 | + | |
533 | 566 | | |
534 | 567 | | |
535 | 568 | | |
| |||
538 | 571 | | |
539 | 572 | | |
540 | 573 | | |
| 574 | + | |
541 | 575 | | |
542 | 576 | | |
543 | | - | |
544 | | - | |
545 | | - | |
| 577 | + | |
| 578 | + | |
546 | 579 | | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
547 | 597 | | |
548 | 598 | | |
549 | 599 | | |
| |||
580 | 630 | | |
581 | 631 | | |
582 | 632 | | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
583 | 676 | | |
584 | 677 | | |
585 | 678 | | |
| |||
951 | 1044 | | |
952 | 1045 | | |
953 | 1046 | | |
954 | | - | |
955 | | - | |
956 | | - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
957 | 1052 | | |
958 | 1053 | | |
959 | 1054 | | |
| |||
1352 | 1447 | | |
1353 | 1448 | | |
1354 | 1449 | | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
1355 | 1459 | | |
1356 | 1460 | | |
1357 | 1461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
42 | 54 | | |
43 | 55 | | |
44 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
637 | 673 | | |
638 | 674 | | |
639 | | - | |
| 675 | + | |
| 676 | + | |
640 | 677 | | |
| 678 | + | |
641 | 679 | | |
642 | 680 | | |
643 | 681 | | |
| |||
647 | 685 | | |
648 | 686 | | |
649 | 687 | | |
650 | | - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
651 | 693 | | |
652 | 694 | | |
653 | 695 | | |
654 | 696 | | |
| 697 | + | |
| 698 | + | |
655 | 699 | | |
656 | 700 | | |
657 | 701 | | |
658 | 702 | | |
659 | 703 | | |
660 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
661 | 711 | | |
662 | 712 | | |
663 | 713 | | |
664 | 714 | | |
| 715 | + | |
| 716 | + | |
665 | 717 | | |
666 | 718 | | |
667 | | - | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
668 | 725 | | |
669 | 726 | | |
670 | | - | |
| 727 | + | |
671 | 728 | | |
672 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
673 | 740 | | |
674 | 741 | | |
675 | 742 | | |
| |||
708 | 775 | | |
709 | 776 | | |
710 | 777 | | |
711 | | - | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
712 | 783 | | |
713 | 784 | | |
714 | 785 | | |
| |||
724 | 795 | | |
725 | 796 | | |
726 | 797 | | |
727 | | - | |
728 | | - | |
| 798 | + | |
| 799 | + | |
729 | 800 | | |
730 | 801 | | |
731 | 802 | | |
| |||
775 | 846 | | |
776 | 847 | | |
777 | 848 | | |
778 | | - | |
779 | | - | |
| 849 | + | |
| 850 | + | |
780 | 851 | | |
781 | 852 | | |
782 | 853 | | |
| |||
822 | 893 | | |
823 | 894 | | |
824 | 895 | | |
825 | | - | |
826 | | - | |
| 896 | + | |
| 897 | + | |
827 | 898 | | |
828 | 899 | | |
829 | 900 | | |
| |||
867 | 938 | | |
868 | 939 | | |
869 | 940 | | |
870 | | - | |
871 | | - | |
| 941 | + | |
| 942 | + | |
872 | 943 | | |
873 | 944 | | |
874 | 945 | | |
| |||
897 | 968 | | |
898 | 969 | | |
899 | 970 | | |
900 | | - | |
901 | | - | |
| 971 | + | |
| 972 | + | |
902 | 973 | | |
903 | 974 | | |
904 | 975 | | |
| |||
930 | 1001 | | |
931 | 1002 | | |
932 | 1003 | | |
933 | | - | |
934 | | - | |
| 1004 | + | |
| 1005 | + | |
935 | 1006 | | |
936 | 1007 | | |
937 | 1008 | | |
| |||
0 commit comments