Skip to content

feat(check): dependency-aware staleness - #126

Merged
HMAKT99 merged 1 commit into
mainfrom
dep-aware-staleness
Jul 3, 2026
Merged

feat(check): dependency-aware staleness#126
HMAKT99 merged 1 commit into
mainfrom
dep-aware-staleness

Conversation

@HMAKT99

@HMAKT99 HMAKT99 commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Closes #124.

What

akf check staleness was per-file: stamp auth.py green, change a helper it imports, and the stamp stayed OK while the thing it verified was no longer true.

Now:

  • stamp_file records content hashes of the file's first-degree local imports (new python/akf/deps.py: AST-based, resolves same-dir and package-relative modules; stdlib/site-packages ignored) into unit.meta["deps"]
  • akf check verifies those hashes and flips STALE reason=dependency_changed when any dependency moved — even though the stamped file's own bytes are unchanged
$ akf stamp main.py --evidence "tests pass"   # records helper.py's hash
$ echo 'def help(): return 999' > helper.py    # main.py untouched
$ akf check main.py
STALE ... reason=dependency_changed

Deliberately conservative per the issue discussion: first-degree only (full closure is expensive), local files only. Deleted/unreadable deps count as changed.

Testing

  • 7 new tests: local-import resolution (stdlib/third-party ignored), package imports, dep-edit → STALE, deleted dep → STALE, untouched deps stay OK, meta recording
  • Full suite: 1950 passed, 2 skipped

Credit: Dipankar Sarkar, who spotted the gap on the launch post.

A stamp on auth.py is a claim about auth.py as it behaved with the
modules it imports. Now:

- stamp_file records content hashes of first-degree local imports
  (Python files; stdlib/site-packages ignored) in unit.meta['deps']
- akf check flips STALE reason=dependency_changed when any recorded
  dependency's content no longer matches — even though the stamped
  file's own bytes never moved

Conservative scope per the issue discussion: first-degree only,
local-file resolution only. Credit: Dipankar Sarkar (dev.to).
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
akf Ready Ready Preview, Comment Jul 3, 2026 2:42pm
akf18 Ready Ready Preview, Comment Jul 3, 2026 2:42pm

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

AKF Trust Certification — ✅ Certified

❌ 0/11 files certified · average trust 0.45 · 3 failed

File Trust Evidence Issues
skills/check.md 0.26 other ai_content_without_review, trust_below_threshold, hallucination_risk, knowledge_laundering, ungrounded_ai_claims, excessive_ai_concentration, provenance_gap, unknown, unknown, unknown, unknown, unknown, unknown, unknown
skills/hermes-akf/SKILL.md 0.54 human_review ai_content_without_review, hallucination_risk, knowledge_laundering, ungrounded_ai_claims, excessive_ai_concentration, provenance_gap, unknown, unknown, unknown, unknown, unknown, unknown
skills/openclaw-akf/SKILL.md 0.54 human_review ai_content_without_review, hallucination_risk, knowledge_laundering, ungrounded_ai_claims, excessive_ai_concentration, provenance_gap, unknown, unknown, unknown, unknown, unknown, unknown

Total: 11 | Certified: 0 | Failed: 3 | Skipped: 8

Generated by AKF Certify

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check: staleness misses transitive invalidation (dependency closure)

1 participant