Skip to content

Offline history: independently prove ancestry, roots and change counts #73

Open

Description

@abogun-product

Offline Repository Analysis v1 proves the pinned commit/tree inventory and admitted source bytes, and deterministically replays recorded change observations. It does not carry the complete parent graph or raw historic trees needed to independently prove root traversal, ancestor membership, numstat counts and history completeness.

Current cost: a third party can replay the history observations but must trust their acquisition; a deliberately rehashed history input can alter hotspot counts. Counts remain separate descriptive evidence with explicit coverage, without health, productivity or acceptance authority. This boundary is documented in the native contract and guide.

Follow-up acceptance:

  • Define a bounded parent/object proof and lineage for independently admitting history/root claims.
  • Reject a rehashed forged ancestor, root, count and complete-history claim.
  • Preserve old v1 replay; missing proof retains an explicit gap.
  • Include shallow graphs, merges, clock skew, large histories and SHA-256 Git repositories.

Related: #72. This is source-history proof hardening, not external deployment or calibration.

Activity

  1. andy-zen-dev commented on Oct 24, 2026

    @andy-zen-dev

    2026-10-24 independent bounded audit: byte-line edit counts (PR #81)

    Exact source reviewed: PR #81 head a4761daa9fa87026ea106a3d722e7299b3de3b8b, src/devostasis/codeanalysis/history_proof.py::line_edits, blob f5f0445cba726571b88ac77fec6f440e58e22c78 (function lines 215–248). This is not approval of the full #73 implementation or the 0.6.0 release.

    Executed independent differential check: transcribed the exact line_edits function into an isolated Python harness and compared its (added, deleted, status, reason) results with an independently written dynamic-programming LCS oracle. Exhaustive finite sample of 125 distinct byte strings, including empty values, 1–4 repeated LF-terminated A/B lines, optional unterminated A/B suffixes and blank lines; all 15,625 ordered before/after pairs agreed (0 mismatches). Explicit NUL/binary, DIFF_LINE_CAP, and DIFF_WORK_CAP controls returned the expected conservative states. The prepared pytest module has 3/3 PASS only against the isolated source-faithful stub, with 15,625 checks inside one bounded test; it compiles on this runner.

    Meaning and limits: this adds an independently executed oracle for the local Myers byte-line count concern under a bounded input domain. It does not test derive_history(), real object proofs, source/installed wheel integration, the repository's actual test suite, historical bundle replay, nor hosted CI. No failure was found in this unit, and the algorithm is not claimed formally proven. The head's upstream PR-triggered CI runs remain action_required / NOT_PASS.

    Integration handoff: place test_devostasis_line_edits_oracle.py in the repository test suite under an implementation-local name (do not mint or reuse permanent research case IDs), run it against the real module on the exact head, then run full Python >=3.12 pytest, historical v1/v2 replay and exact-head CI before accepting/merging. Local prepared module is available in this run's artifact; no GitHub commit/PR/merge was made, because the connected andy-zen-dev identity currently has pull=true, push=false.

    Related #86 (commit-header shape) and #82 (tree canonicality) remain independently blocking proof-admission concerns; these results do not resolve them.

  2. andy-zen-dev commented on Oct 25, 2026

    @andy-zen-dev

    2026-10-25 additional deterministic LF-byte edit QA (Issue #73)

    Exact source anchor: PR #81 a4761daa9fa87026ea106a3d722e7299b3de3b8b, src/devostasis/codeanalysis/history_proof.py::line_edits, blob f5f0445cba726571b88ac77fec6f440e58e22c78. This extends the earlier 15,625-pair A/B-only exhaustive check in this Issue; it does not supersede it.

    Actually executed (isolated source-faithful function, Python 3.13.5): a second, independently coded LF-only dynamic-programming LCS oracle on 20,000 seeded before/after pairs (seed 20261025). The corpus includes raw 0xff, UTF-8 é, CR embedded within a line, spaces, blank lines, repeated lines and both terminated/unterminated final lines. Outcome: 20,000/20,000 identical (added, deleted, status, reason) results. Explicit DIFF_WORK_CAP / DIFF_LINE_CAP and NUL/BINARY boundaries remain conservative. A candidate two-test pytest module ran 2/2 PASS using the isolated source-faithful stub, not an installed Devostasis checkout.

    A compact reproduction using the current implementation after checkout:

    import random
    from devostasis.codeanalysis.history_proof import line_edits
    
    def lf(v):
        p = v.split(b"\n")
        return [x + b"\n" for x in p[:-1]] + ([p[-1]] if p[-1] else [])
    
    def oracle(a, b):
        x, y = lf(a), lf(b)
        table = [[0] * (len(y) + 1) for _ in range(len(x) + 1)]
        for i in range(len(x)):
            for j in range(len(y)):
                table[i+1][j+1] = (table[i][j]+1 if x[i] == y[j]
                                  else max(table[i+1][j], table[i][j+1]))
        k = table[-1][-1]
        return len(y)-k, len(x)-k, "VERIFIED", None
    
    rng = random.Random(20261025)
    tokens = (b"", b"a", b"b", b"\xff", b"\r", b"a\r", b"Z  ", b"\xc3\xa9")
    for _ in range(20000):
        a = b"\n".join(rng.choice(tokens) for _ in range(rng.randrange(13)))
        b = b"\n".join(rng.choice(tokens) for _ in range(rng.randrange(13)))
        if rng.randrange(2): a += b"\n"
        if rng.randrange(2): b += b"\n"
        assert line_edits(a, b, {"max_diff_lines": 100,
                                  "max_diff_work": 100000}, [0]) == oracle(a, b)

    Result/limit: no new defect found for this bounded count algorithm; this is additional regression evidence, not a review of the complete proof chain, derive_history, v1/v2 historical replay, package smoke, or hosted CI. Full repository pytest and exact-head CI are NOT_RUN. No new issue is needed; #73 and the stacked release PRs remain open. Upstream code publication remains blocked by andy-zen-dev permissions (push=false).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions