Skip to content

🚸 Verify lineage for scripts created by agents using a deterministic function - #3846

Open
sheetalgiri wants to merge 22 commits into
mainfrom
verify_lineage_when_using_agents
Open

🚸 Verify lineage for scripts created by agents using a deterministic function#3846
sheetalgiri wants to merge 22 commits into
mainfrom
verify_lineage_when_using_agents

Conversation

@sheetalgiri

@sheetalgiri sheetalgiri commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
  • Added verify_lineage() function that parses a Python script with ast and checks:

    • lineage tracking calls (ln.track(...) / ln.finish(...) or imported equivalents)
    • LaminDB input retrieval patterns (e.g. ln.Artifact.get(...), ln.Collection.filter(...), etc.)
    • LaminDB output persistence patterns (.save() / ln.save(...))
    • suspicious non-LaminDB input reads (e.g. pd.read_*, open, np.load, etc.)
  • Updated skills.md so that for every python script that the agent creates/plans to run, it verifies the lineage by calling the function and doing assertions on the verification results, make sure everything passes. If there is a failure, it goes back and makes modifications to the script and runs the function again.

Why:

  • Agents can be unreliable when it comes to doing the lineage tracking properly

Limitations:

  • Only supports python scripts

Ebad371 and others added 9 commits August 5, 2026 12:17
…d checks:

- lineage tracking calls (ln.track(...) / ln.finish(...) or imported equivalents)
- LaminDB input retrieval patterns (e.g. ln.Artifact.get(...), ln.Collection.filter(...), etc.)
- LaminDB output persistence patterns (.save() / ln.save(...))
- suspicious non-LaminDB input reads (e.g. pd.read_*, open, np.load, etc.)
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.84962% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.14%. Comparing base (112244e) to head (b898e0e).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
lamindb/core/_verify_lineage.py 89.81% 27 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3846      +/-   ##
==========================================
- Coverage   91.55%   87.14%   -4.41%     
==========================================
  Files          88       89       +1     
  Lines       15747    16036     +289     
==========================================
- Hits        14417    13975     -442     
- Misses       1330     2061     +731     
Files with missing lines Coverage Δ
lamindb/core/__init__.py 62.50% <100.00%> (-11.42%) ⬇️
lamindb/core/_context.py 89.41% <ø> (ø)
lamindb/core/_verify_lineage.py 89.81% <89.81%> (ø)

... and 15 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deployment URL: https://305e5521.lamindb.pages.dev

sheetalgiri and others added 10 commits August 6, 2026 17:57
- Instead of having checks like has_lamindb_inputs and has_lamindb_outputs, use checks has_external_inputs and has_external_outputs. in this case even if there is no input/output a script can be correct
- if there are external inputs/outputs printing those function calls, to help guide the agent in what it should fix
lamin-cli: points to main (#254 merged).
lamin-skills: points to the latest commit on sheetalgiri-patch-1
(includes the --session-id finish fix on top of verify_lineage).
lamin-cli: points to main (#255 merged).
lamin-skills: points to the latest commit on the still-open
sheetalgiri-patch-1 branch.
…bs/lamindb into verify_lineage_when_using_agents
- checks for file names in a script like 'x.txt'or 's.npy'or anything and whether or not they are associated with a lamin call or not , regardless of what it is, directly or indirectly, if all file names have this kind of association the function passes the script
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.

2 participants