Skip to main content

Session Write

@vcjdeboer/session-writev2026.07.16.1· 1mo agoMODELS
01README

Let an AI fill in an analysis template without letting it touch the science. Governed parameter-fill: the AI fills ONLY the typed parameter slots of a frozen template, and validate is the deterministic gate that asserts the frozen structure was untouched and every fill satisfies its slot contract — bounded, validated, reproducible AI authoring, not free-form code generation. author builds Quarto (.qmd) or Jupyter (.ipynb) templates from structured cells (the writer owns the document layout and binds each param at its declared type) for R or Python; init wires an R project to record its work. The guarantee: what the AI can change is exactly the typed slots and nothing else — the template is the contract.

02Models1
@vcjdeboer/session-writev2026.07.16.1session_write.ts
fn init()
R-project on-ramp. Run from the project: SWAMP_REPO_DIR=<swamp> swamp model method run writer init --input projectPath="$PWD". Writes swamp.qmd + .claude/settings.local.json; arms swamprecord against the rec ledger. repoDir resolves from --input repoDir, else SWAMP_REPO_DIR env, else cwd (--repo-dir does NOT set it in-method).
fn validate()
Assert the filled .qmd left the structure frozen and every parameter satisfies its slot contract
fn pin()
Seal the fill's data: fingerprint each dataset-path slot's file and record it into swamp.datapins, so a later validate detects drift
fn author()
Assemble a governed template from a typed authoring-intent and round-trip it: the all-samples fill must VALIDATE and every contract slot's antisample must be REJECTED; the .qmd is written to outPath ONLY on pass. Returns the verdict the factory's round-trip gate reads.

Resources

validation(infinite)— Result of validating a filled template against its slot contracts
init(infinite)— Record of wiring an R project to the suite (the swamp.qmd written into it)
authoring(infinite)— Result of authoring a governed template — the round-trip verdict plus the emitted path + sha256
03Previous Versions12
2026.07.04.1
2026.07.03.1

session-write 2026.07.03.1 — Governed dataset input contracts

The input-side counterpart to the existing swamp.returns output gate: declare what a dataset must be, and have it checked and sealed at fill time.

Features

  • Schema-level input contractsrequires_columns(a,b) on a dataset slot declares required columns, now checked against the file's actual header at validate (previously deferred to execute and never run).
  • Format-aware sealing — dataset files are classified (csv / xlsx / binary); non-CSV files (plates, multi-sheet Excel) are sealed by hash without fabricating columns. New optional format: slot gate catches a renamed CSV posing as .xlsx (and vice versa).
  • Multi-dataset templatescolumn / formula slots resolve their of dataset and validate against that file's columns (e.g. meta + data), not a merged list. An of naming no dataset slot is flagged.
  • dataset_glob slot — point a slot at a directory of same-schema files (file-per-sample); optional glob: "*.csv" filter. Each file is format/column-checked and sealed as its own pin.
  • New pin method — fingerprints dataset (and glob) files and records swamp.datapins so validate detects drift. Writes atomically; optional templatePath + force refuse to seal a tampered/invalid fill.
  • AuthoringauthorRoundTrip now emits dataset_glob / format / glob slots.

Fixes & hardening

  • Quote-aware CSV header parsing (embedded commas no longer split a column).
  • Plain-YAML (targets-style) config fills are sealed without being wrapped in --- frontmatter.
  • A dataset that passes the path gate but is unreadable now fails validation instead of being silently swallowed.

Modified 1 models

2026.06.29.1
2026.06.27.3
2026.06.27.2

updated labels

2026.06.27.1
2026.06.24.1

Modified 1 models

2026.06.22.1

repoDir auto-resolves (explicit --input repoDir → SWAMP_REPO_DIR env → cwd) so the SWAMP_REPO_DIR= on-ramp form bakes the correct control-plane path into swamp.qmd; add resolveRepoDir unit test; surface the R-project on-ramp in description/labels.

Modified 1 models. updated labels

2026.06.21.6
2026.06.21.5
2026.06.21.4
2026.06.21.3
04Stats
A
100 / 100
Downloads
0
Archive size
89.5 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
05Platforms
06Labels