Repository navigation
measurement: timing, noise rule and precheck in a new package; task image builds as a runner; short prompts by default - #66
Conversation
… not_approved rules
…) with the in-image check
…gs the gate lease id
…s, license, PR author, prompt audit); register measure in the CLI
…ges import with the standard library
… run it with system python
…mpt check, model drafts for review FC_PROMPT_VERSION=short leaves the linked issues out of the prompt and asks the extractor for symptoms only; fc-verify prompt-check, prompt-draft and prompt --drafts; readiness reports prompt findings.
…mulacode-verified-rl uses Unpinned, the dependency resolved to harbor's main, which is 1305 commits behind; the lock had f600c47 (February).
There was a problem hiding this comment.
It might be better to make a new class called RenderShortProblemsRunner and set that as the default.
| HUNK = re.compile(r"^@@ -(\d+)(?:,(\d+))? ") | ||
|
|
||
|
|
||
| def old_ranges(diff): |
There was a problem hiding this comment.
Advice: use https://github.com/DietrichGebert/ponytail/ to ensure that the helper functions are not already maintained in an external package.
| return out | ||
|
|
||
|
|
||
| def overlapping(image_diff, patch_text): |
There was a problem hiding this comment.
Advice: use https://github.com/DietrichGebert/ponytail/ to ensure that the helper functions are not already maintained in an external package.
There was a problem hiding this comment.
This file seems sloppy. I would have expected this to be part of a common set of utilities for verification. Unsure whether this will be an issue on separate EC2 instances.
There was a problem hiding this comment.
It seems like a separate src/datasmith/measurement/ module for these rules would be useful. Also, use https://github.com/DietrichGebert/ponytail/ to ensure that the helper functions are not already maintained in an external package.
There was a problem hiding this comment.
Is this still needed? Why do we need a meta-prompt editor when we can directly edit the prompt(s)? Try folding this into the upstream components of datasmith.
There was a problem hiding this comment.
Isn't the publishing a downstream step in fc-data? Why is this needed?
There was a problem hiding this comment.
I'm not sure why this belongs to the /verify module.
There was a problem hiding this comment.
Not sure why this is in /verify
There was a problem hiding this comment.
Seems like many of our /verify/* sub-modules are utilities that run either on docker container startup or on tear-down.
There was a problem hiding this comment.
The internal organization of the /verify/ folder is a complete mess and extremely sloppy. Each sub-component should be redone with a https://github.com/DietrichGebert/ponytail/blob/main/skills/ponytail/SKILL.md pass. Three issues I'm generally seeing:
- Utilities as main modules -- Maybe a
datasmith.verify.utils.*would be better organization for these? - Many repeated functionalities that have no justification for being in the verification module -- such as meta-level prompt editing skills.
- The many valid verification skills are currently grouped into: within image / perpetual services / and "others". This misc grouping (files under datasmith.verify.*) are not well motivated to be top-level modules.
…moved from verify
…elete verify/capture.py
… a slot of a host lock folder instead of the HTTP measure gate
…late-v1.4); delete the in-image coverage check
…sRunner, the image pin at render time; delete verify images, pin, registry, scrub and env_image
…giveaways, and is the pipeline default; drop FC_PROMPT_VERSION
…rt); drop the unused grade hook
…re) and fc-build-tasks expose what stays
… when it cannot be read
…mark the configured Supabase URL open as allowed
Purpose
The first version of this PR put the task approval steps in one package,
verify/, with a command for each step. Review found that the package mixed unrelated concerns, kept utilities as main modules, edited rendered prompts after the fact and ran an HTTP service on the host. This version moves each part to the package of its domain, deletes the survey workflow (formulacode-verified-rl keeps it) and replaces the HTTP measure gate with a lock folder. The short prompt is now a runner class and the pipeline default.How it works
New and changed files:
Lock folder in place of the measure gate.
FC_MEASURE_LOCK_DIRsets the folder (default/tmp/fc-measure-lock).fc-measure measuremakes the folder withFC_MEASURE_LOCK_SLOTSfiles (default 9, the slot count of the old gate) when it is empty./fc-measure-lock.tests/measure_lock.sh, in task template v1: the Phase 1 template and its fixes in one branch, for one merge into main #65) takes a slot withflockfor each timing step and logs<step> <slot> 1or<step> none 0tomeasure_gate.txt.0line, or with no log, counts as an infrastructure failure, so the job runs again.Where each former
verify/module went, and why.noise.pymeasurement/noise.pysurvey.py.agents.pymeasurement/agents.pymeasure.pymeasurement/run.pyrelease-leasescommand).result.jsonloads with harbor'sTrialResultmodel. Functions take paths, not aSurveyobject.services/measure_gate.pycapture.pyrunners/harbor_healthcheck.py(snapshots_dir) andmeasurement/run.snapshot_mismatchtest.shand the task copy are gone.precheck.py,in_image/coverage_check.pymeasurement/precheck.pyby_deps,always_affected,edited_beforeandedited_overlapin the image build check.precheck()loads them fromcandidate_containers.build_manifestanddecide()compares them.images.pydocker/images.py,docker/manifest.py,runners/build_task_images.pydocker/and a pipeline step goes inrunners/. Duplicate helpers are deleted (shell call, image check, disk checks, JSON fetch).pin.pyharbor_adapter/utils.render_task_toml(docker_image=),regen render --imagestask.tomlwhen the task renders. No tool editstask.tomlafter the render.scrub.pyscrub_git.shruns at the end of every image build (#50).env_image.pySynthesizeImagesRunneralready builds the environment image atbase_sha.registry.pyaws/ecr_push.py. Publishing is a step offc-data.selection.pyregen export --from-dbrecords.to_recordandutils.db.fetch_all. The sampling policy stays in formulacode-verified-rl.prompts.py,prompt_check.py,short_prompt.pyrunners/render_problems.RenderShortProblemsRunnerinstruction.md. formulacode-verified-rl keepsapply_gold_prompt.py.review.py,survey.py,report.py,release.py,status.pycli.pymeasurement/cli.py(fc-measure),runners/build_task_images.main(fc-build-tasks)Changes
fc-measure measure TASKS_ROOT OUT TASK ...writesOUT/oracle/<task>.jsonwith 3 oracle runs and 3 no-change runs per task. Each run also recordssnapshot_mismatch, which is the count of snapshot entries that pass or skip in the oracle reference and fail in that run.yaml.fc-verify measure SURVEY TASKloaded and wrote the survey state files and needed the HTTP gate./fc-measure-lock.MEASURE_GATE_URLwith a token from a secret file.fc-measure precheck TASKS_ROOT TASK ...loads the measure block from the database and returnsbase_edited,patch_failed,uncoveredor nothing.by_deps, so its task is measured.docker runofcoverage_check.pyin the task image, with the result cached incoverage/<task>.json.run_harbor_healthcheck(..., snapshots_dir=DIR)also copies each oracle reference with at least one entry that is not a skip toDIR/<task>/.captureran 2 extra harbor jobs per task on a copy of the task with a rewrittentest.sh.fc-build-tasks TASKS_ROOT OUTbuilds each task withBuildTaskImagesRunner, so it gets the progress rows and the end summary ofBaseRunner. A verified image stays on the Docker daemon, and an image that fails its check is removed.utils.docker_prune.docker_root, now public).fc-verify buildalso saved each image as a zstd archive and checked the free space of/.fc-render-tasks render --images OUT/manifest.jsonlwritesdocker_imageintask.tomlwhen the last verified row of the task has the sameenvironment/digest.fc-verify pinsandpublisheditedtask.tomlafter the render.fc-render-tasks export --from-db --ids-file IDS --out FILEwrites render records for new tasks.fc-verify recordsandselectinselection.py.RenderShortProblemsRunnerpasses no linked issues to the render. It does not store a problem text that names ASV benchmarks, a PR or issue link, code or a diff, or an internal function or class that the patch changes. It raisesPromptLeak, whichBaseRunnercounts.fc-datausesRenderShortProblemsRunnerfor therender_problemsstage and selectspatchfor it.FC_PROMPT_VERSION=short|detailedinRenderProblemsRunner, andprompt-checkandpromptcommands that edited rendered tasks.agents/extractors.pystays.fc-verifyand its entry point.dotenvimport indatasmith/__init__.py, because no command needs to import with the standard library only.oracle_tests_rerunstays innoise.verify. The empty problem text fix goes withprompts.py.e7d19622anduv.lockstay.Usage
RL trials on the same host mount the same folder (harbor
mounts_json):{"type": "bind", "source": "${FC_MEASURE_LOCK_DIR}", "target": "/fc-measure-lock", "read_only": true}Verification
On the head
13b98a0:ruff checkandruff formatpass on the changed files. The 2S310findings inharbor_healthcheck.pyare on the base too.release/template-v1:src: +3555 lines before, +1126 lines now.tests: +1003 lines before, +403 lines now.classify_allandverifygive the same output frommeasurement.noiseas from the oldverify.noise.trial_runon 354 trials of 60 random Phase 1 records:result.jsonfiles load withTrialResult.trial_runon all 354.measure_gate.txt(an older template), so they now count as trials without a lock slot.flockon a file in a read-only bind mount takes the lock inside a container (docker run -v DIR:/l:ro).Notes
FC_SKIP_LSV, precheck fields). Merge task template v1: the Phase 1 template and its fixes in one branch, for one merge into main #65 first.datasmith.verify. They must change next, todatasmith.measurement,datasmith.dockeranddatasmith.harbor_adapter, or keep their own copies./fc-measure-lock. Without the mount,measure_lock.shruns each timing step without a slot.harbor_adapter/utils.pyandadapter.pychange.fc-render-tasks checkreports older renders as changed. Theenvironment/digest and the image tags do not change.scrub_git.shdoes not remove nested.gitfolders, whichscrub.pydid. This is a template change, so it needs the next template version onrelease/template-v1.tests/confirm.jsonin a copy of the task, because the template loads it only from that file.harborcommand with a log file and without secret variables. A shared helper would not be smaller.--max-heavyis gone, because it used the oldcoverage/<task>.jsonfiles.utils/docker_prune.py,runners/harbor_healthcheck.py, and 10 files underverify/that this PR deletes. Itsmeasure --time-limitand prompt changes are inverify/and must move or go.