Skip to content

Skill restructure: Python-first flow-curve-analysis - #47

Open
marcocaggioni wants to merge 1 commit into
masterfrom
skill-code-level
Open

marcocaggioni wants to merge 1 commit into
masterfrom
skill-code-level

Conversation

@marcocaggioni

Copy link
Copy Markdown
Member

Skill restructure: Python-first flow-curve-analysis

Restructures the flow-curve-analysis skill so the agent executes via the
Python API (holding result objects as values) instead of shelling out to the
CLI. Same workflow, same judgment content — new hands.

What changed

  • Python API is now the primary execution route. Steps 1–5 lead with
    rheofit.print_steps / discover_steps / analyze / fit / plot.
    The CLI stays as the quotable plan artifact (every proposed plan still shows
    the equivalent command) and the one-shot terminal route — now a compact
    CLI reference instead of the main text.
  • New "Result objects" contract section, verified against
    analysis.py / models/_fitcore.py: the exact fit() dict keys
    (success, params, redchi, cond, notes, x/y_data/y_fit,
    parent/parent_redchi), the Analysis dataclass fields (results,
    summary columns, outputs, equation, output_dir), and df.attrs
    — plus composition patterns (head-to-head model comparison, seed
    robustness, cross-model summary tables) that only work with values.
  • New executable escalation policy (Step 4): when the approved plan names
    ladder-ordered candidates, the agent climbs programmatically —
    redchi > 0.1 + visible residual structure + all params identified →
    next rung; never switches families; nesting violations get one
    thorough/seed+1 retry. No more "offer to climb" round-trips.
  • "How to Run" collapsed to importability (uv sync / pip install -e . /
    two-line sys.path fallback). The four CLI fallback routes and the PEP 723
    last-resort are gone from the docs; scripts/flow_curve_fit.py stays on
    disk, unreferenced.
  • Step 5 reporting now reads from a.summary / res["notes"] directly;
    Office-workflow tip notes the native-table transcription is direct from values.

Untouched

Fitting Contract, Visualization Contract, model tables (Branch A/B), fixed
Carreau exponents, interview-first golden rule, demo walkthrough (both mermaid
diagrams), material-behaviour reporting guidance, Library Layout, Data Loading
Notes, contributor guides, When to Use, environment packages. Both mirror
copies (.github/skills/ and rheofit/skills/) updated identically.

Checks

  • New result-object claims verified against rheofit/analysis.py,
    rheofit/models/_fitcore.py, rheofit/report.py (exact keys/columns)
  • All 8 executable Python examples ast.parse clean (3 remaining "failures"
    are the pre-existing intentional sketches, unchanged)
  • Fences balanced; no sections dropped (diff reviewed hunk by hunk)

Left unmerged for review.

This branch has not been deployed

No deployments
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.

1 participant