Skip to content

Rules-aware skip memo: re-decode only changed records, invalidate on any rule change #154

Open

Description

@arimendelow

Prompt

Add to crawlkit a small helper that lets a crawler skip re-decoding source records whose bytes have not changed since the last sync, and that invalidates every skip automatically when the crawler's decoding rules change. API sketch: state.RulesSignature(versions map[string]int, rules any) []byte hashes the declared decoder and derivation versions plus a canonical, path-tagged rendering of the rule tables (strings quoted, maps and sets in key order, compiled regular expressions by pattern; panic on an unknown kind so a new table cannot be skipped silently), and a per-record memo compares (source key, byte digest, signature) before the crawler decodes. Keep record storage in the app; crawlkit owns only the signature and the comparison. Reference implementation: https://github.com/ourostack/teamscrawl/blob/main/internal/teamsdesktop/memo.go (MemoSignature, hashValue).

Why

A crawler that re-reads a large local cache on every sync pays to decode records that have not changed. teamscrawl skips them with a per-record byte digest, which made a re-sync of a real Teams cache (about 62,000 messages) do work in proportion to what changed. The subtle part is invalidation: a new credential-scrub key, deny term or regular expression must re-read everything, and hashing the rule tables themselves (rather than relying on someone remembering to bump a version) is what makes that safe.

Why an issue, not a PR

Only teamscrawl uses this today, and crawlkit's boundary asks for at least two apps. If another crawler (slacrawl, discrawl, imsgcrawl) would adopt it, we can send a PR from the proven code; say the word.

Activity

  1. added
    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    on Oct 6, 2026
  2. clawsweeper commented on Oct 6, 2026

    @clawsweeper

    Codex review: this still needs some work.

    Summary
    This issue remains unimplemented; repository policy permits automatic closure only for implemented requests, and shared extraction still needs a second demonstrated consumer and a maintainer scope decision.

    Reproducibility: This is a feature proposal with concrete downstream source; the reported Teams cache performance and memo invalidation were not independently exercised.

    Maintainer decision needed

    • Question: Should extraction wait for a second demonstrated adopter, or should crawlkit sponsor a second adoption?
    • Recommendation: Wait for demonstrated adoption: Retain downstream ownership and revisit extraction when another crawler demonstrates compatible requirements.
    • Why: The downstream implementation is concrete, but the issue establishes only one consumer and the repository requires shared use.

    Next step
    Decide whether to wait for a second demonstrated consumer or sponsor one before defining the shared memo API.

    Review details

    Best possible solution:

    Keep the helper downstream until two crawlers establish a compatible signature and comparison contract with application-owned storage.

    Do we have a high-confidence way to reproduce the issue?

    This is a feature proposal with concrete downstream source; the reported Teams cache performance and memo invalidation were not independently exercised.

    Is this the best way to solve the issue?

    The reference is a useful extraction candidate after shared adoption is established, while decoder and rule-application code changes must retain explicit version invalidation.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • A second crawler with compatible memo requirements has not been demonstrated.
    • A shared contract still needs supported rule types, code-version invalidation duties, and rules for saving memos only after successful processing.

    Codex review notes: model internal, reasoning medium; reviewed against 4fac9f572848.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P3: This optional optimization establishes no broken crawlkit contract and awaits demonstrated shared adoption.
    Evidence reviewed

    What I checked:

    • Current default branch: GitHub identifies main as the default branch, and its commit matches the clean review checkout. (4fac9f572848)
    • Shared ownership boundary: The complete root AGENTS.md and boundary document require reusable mechanics shared across at least two apps, with provider privacy rules and schemas remaining downstream. (docs/boundary.md:3, 4fac9f572848)
    • Existing state APIs do not implement the request: State source, adapters, tests, and package documentation implement opaque values, cursors, and time-based freshness; they provide no decoding-rule signature or per-record memo comparison. (state/state.go:95, 4fac9f572848)
    • Adjacent mechanisms have different contracts: Worker revisions are application-supplied opaque values, while snapshot skip planning compares archive manifests; neither derives rule-aware source-record identities. (worker/worker.go:25, 4fac9f572848)
    • Discussion and canonical search: The full issue body establishes Teamscrawl as the only current consumer; both comments are automation comments, and timeline plus all-state searches for memo, decode, signature, invalidation, and unchanged established no fixing PR or canonical replacement. Captured body identity: 60600ee5ce4f9fb0666e6977d305b966497bd90ec863970cb6447c16406042a7.
    • Related scope decision: In Add pure-Go Chromium cache readers (LevelDB, IndexedDB, V8) #156, steipete declined the separate Chromium-reader extraction pending demonstrated shared adoption; that comment does not explicitly decide this issue. The inspected downloaded screenshot demonstrates Chromium decoding, without memo reuse or rule-change invalidation. build(deps): fix SQLite lock-wait cancellation #169 instead fixes SQLite cancellation.
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed November 3, 2026, 11:59 PM ET / November 4, 2026, 04:59 UTC.

  3. added
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    and removed
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    on Oct 16, 2026
  4. 281 remaining items

  5. added
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    and removed
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    on Oct 30, 2026
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

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions