MCPcopy Create free account
hub / github.com/Open-Quant/openquant / cmd_next

Function cmd_next

scripts/afml_docs_loop.py:296–312  ·  view source on GitHub ↗
(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

294
295
296def cmd_next(args: argparse.Namespace) -> int:
297 state = read_state()
298 for chapter, section in iter_sections(state):
299 if section["status"] == "pending":
300 section["status"] = "in_progress"
301 chapter["status"] = recompute_chapter_status(chapter)
302 write_state(state)
303
304 prompt_path = PROMPTS_DIR / f"{section['id']}.md"
305 print(f"Next section: {section['id']}")
306 print(f"Chapter: {chapter['chapter']} | Module: {section['module']} | Slug: {section['slug']}")
307 print(f"Prompt file: {prompt_path}")
308 if args.print_prompt:
309 print("\n" + prompt_path.read_text(encoding="utf-8"))
310 return 0
311 print("No pending sections. All sections are done.")
312 return 0
313
314
315def cmd_done(args: argparse.Namespace) -> int:

Callers

nothing calls this directly

Calls 4

read_stateFunction · 0.85
iter_sectionsFunction · 0.85
recompute_chapter_statusFunction · 0.85
write_stateFunction · 0.85

Tested by

no test coverage detected