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, and repository policy permits automatic closure only for implemented requests; shared extraction still needs a second adopter and a maintainer scope decision.

    Reproducibility: This is a feature proposal with inspected downstream source; the reported Teams cache performance was not independently exercised.

    Maintainer decision needed

    • Question: Should shared extraction wait for a second crawler to demonstrate compatible rules-aware memo requirements?
    • Recommendation: Wait for demonstrated adoption: Retain downstream ownership and revisit extraction when another crawler demonstrates compatible requirements.
    • Why: The downstream reference is concrete, but the report establishes only one adopter and the repository requires shared use.

    Next step
    Decide whether to wait for a second demonstrated adopter 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 app-owned storage.

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

    This is a feature proposal with inspected downstream source; the reported Teams cache performance was not independently exercised.

    Is this the best way to solve the issue?

    The downstream helper is a useful starting point after shared adoption is established, but table hashing must preserve explicit version bumps for decoder and rule-application code changes.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

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

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

    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 current SHA matches the clean checkout. (b7cf3a6de3dc)
    • Shared ownership requirement: The complete root AGENTS.md and ownership map require provider-neutral mechanics shared across at least two apps and retain privacy rules downstream. (docs/boundary.md:3, b7cf3a6de3dc)
    • Existing state behavior: State source, adapters, tests, and package documentation implement opaque cursors and elapsed-time freshness, without rules-aware record memoization. (state/state.go:95, b7cf3a6de3dc)
    • Adjacent capabilities: Worker revisions are app-supplied opaque values, and snapshot planning compares archive-file manifests; neither derives signatures from decoding rules. (worker/worker.go:25, b7cf3a6de3dc)
    • Discussion and canonical search: The issue identifies only Teamscrawl as an adopter; both comments are automation comments, and searches across issues and PRs for memo, rules, decode, and invalidation found no canonical implementation or open fixing PR.
    • Related scope decision and proof: In Add pure-Go Chromium cache readers (LevelDB, IndexedDB, V8) #156, steipete declined the separate Chromium-reader extraction pending shared adoption; this does not explicitly settle this issue. Its downloaded screenshot demonstrates Chromium decoding, without memo comparison or rule-change invalidation. The merged build(deps): fix SQLite lock-wait cancellation #169 addresses 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 October 30, 2026, 2:48 AM ET / 06:48 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. 260 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 29, 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