Sort the added imports and type the parallel-chunks value for mypy
This commit is contained in:
@@ -7,9 +7,9 @@ from release_plan.release_standing import DefaultPlan, project_plan, UNSEEN_RELE
|
|||||||
from loop_effects.effects import Effects, say
|
from loop_effects.effects import Effects, say
|
||||||
from failure import Failure
|
from failure import Failure
|
||||||
from loop_claude.routing import first_route, kept, routed_item
|
from loop_claude.routing import first_route, kept, routed_item
|
||||||
|
from plan_store.stores import held_at, Plan, store as plan_store
|
||||||
from loop_claude.loop.chunk_windows import held_beside, item_of
|
from loop_claude.loop.chunk_windows import held_beside, item_of
|
||||||
from chunk_preflight.main import ITEM
|
from chunk_preflight.main import ITEM
|
||||||
from plan_store.stores import held_at, Plan, store as plan_store
|
|
||||||
from release_plan.todo_table import Item
|
from release_plan.todo_table import Item
|
||||||
from model_routing.ladder import Ladder, Rung
|
from model_routing.ladder import Ladder, Rung
|
||||||
from transcript_archive.read import latest_worker
|
from transcript_archive.read import latest_worker
|
||||||
|
|||||||
@@ -5,21 +5,21 @@ import pathlib
|
|||||||
import re
|
import re
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
from chunk_preflight.choices import planned
|
|
||||||
from chunk_preflight.gathered import NoItem, Plan
|
|
||||||
from claude_code.session import Session, session_named, transcript_file
|
|
||||||
from claude_code.transcript import read_transcript
|
|
||||||
from failure import Failure
|
|
||||||
from git_cli.git_repo import default_ref
|
|
||||||
from loop_claude import tmux
|
|
||||||
from loop_claude.cycle import chunk_items
|
|
||||||
from loop_claude.loop.reload import LoopRun
|
|
||||||
from loop_effects.effects import Effects, say
|
|
||||||
from loop_state.paths import Paths
|
|
||||||
from project_config.main import located
|
|
||||||
from release_plan.release_standing import project_plan
|
|
||||||
from touch_predictions.beside import Beside, chunks_beside
|
from touch_predictions.beside import Beside, chunks_beside
|
||||||
|
from loop_claude.cycle import chunk_items
|
||||||
|
from git_cli.git_repo import default_ref
|
||||||
|
from loop_effects.effects import Effects, say
|
||||||
|
from failure import Failure
|
||||||
|
from project_config.main import located
|
||||||
|
from loop_claude.loop.reload import LoopRun
|
||||||
|
from chunk_preflight.gathered import NoItem, Plan
|
||||||
|
from loop_state.paths import Paths
|
||||||
|
from chunk_preflight.choices import planned
|
||||||
from transcript_archive.project_key import project_key
|
from transcript_archive.project_key import project_key
|
||||||
|
from release_plan.release_standing import project_plan
|
||||||
|
from claude_code.transcript import read_transcript
|
||||||
|
from claude_code.session import Session, session_named, transcript_file
|
||||||
|
from loop_claude import tmux
|
||||||
|
|
||||||
# Under the home folder, a folder per project key holds LOCK.
|
# Under the home folder, a folder per project key holds LOCK.
|
||||||
STATE = ".local/state/loop-claude"
|
STATE = ".local/state/loop-claude"
|
||||||
@@ -62,7 +62,7 @@ def starting(home: pathlib.Path, key: str) -> typing.Iterator[None]:
|
|||||||
|
|
||||||
def held_items(chunks: typing.Iterable[str], key: str, claude_code_transcripts: pathlib.Path) -> set[int]:
|
def held_items(chunks: typing.Iterable[str], key: str, claude_code_transcripts: pathlib.Path) -> set[int]:
|
||||||
"""The plan items these chunks hold: the one each started from, and those its worker names on its latest `Chunk items:` line so far. A chunk whose transcript cannot be read holds the item it started from."""
|
"""The plan items these chunks hold: the one each started from, and those its worker names on its latest `Chunk items:` line so far. A chunk whose transcript cannot be read holds the item it started from."""
|
||||||
held = set()
|
held: set[int] = set()
|
||||||
for chunk in chunks:
|
for chunk in chunks:
|
||||||
held.update(filter(None, [item_of(chunk)]))
|
held.update(filter(None, [item_of(chunk)]))
|
||||||
transcript = transcript_file(chunk_session(key, chunk, claude_code_transcripts))
|
transcript = transcript_file(chunk_session(key, chunk, claude_code_transcripts))
|
||||||
|
|||||||
@@ -6,11 +6,13 @@ from transcript_archive.location import archive_root, project_archive
|
|||||||
from loop_claude.loop.chunk_start import archived_route, chunk_start, fetched_todo, routed
|
from loop_claude.loop.chunk_start import archived_route, chunk_start, fetched_todo, routed
|
||||||
from loop_claude.loop.routing_check import check_routing
|
from loop_claude.loop.routing_check import check_routing
|
||||||
from loop_claude.project.checkout import checkout_root
|
from loop_claude.project.checkout import checkout_root
|
||||||
|
from loop_claude.loop.chunk_windows import CHUNK_FLAG, chunk_session, start_chunks
|
||||||
from loop_claude.loop.close import closed_cycle
|
from loop_claude.loop.close import closed_cycle
|
||||||
from loop_claude.cycle.run import Cycle, run_cycle
|
from loop_claude.cycle.run import Cycle, run_cycle
|
||||||
from loop_claude.loop.reload import decode_handed, exec_if_edited, fingerprint, LoopRun, RELOAD_FLAG
|
from loop_claude.loop.reload import decode_handed, exec_if_edited, fingerprint, LoopRun, RELOAD_FLAG
|
||||||
from loop_effects.effects import Effects, say
|
from loop_effects.effects import Effects, say
|
||||||
from failure import Failure
|
from failure import Failure
|
||||||
|
from loop_claude.verdicts import Finished
|
||||||
from loop_claude.project.model_choice import get_or_ask_models
|
from loop_claude.project.model_choice import get_or_ask_models
|
||||||
from git_cli.git_repo import Git
|
from git_cli.git_repo import Git
|
||||||
from loop_claude.loop.usage import HELP
|
from loop_claude.loop.usage import HELP
|
||||||
@@ -20,11 +22,9 @@ from transcript_archive.project_key import project_key
|
|||||||
from model_routing.ladder_file import project_ladder_file, read_ladder, SHIPPED
|
from model_routing.ladder_file import project_ladder_file, read_ladder, SHIPPED
|
||||||
from loop_claude.project.premises import read_premises
|
from loop_claude.project.premises import read_premises
|
||||||
from loop_claude.project.records import read_records
|
from loop_claude.project.records import read_records
|
||||||
from loop_claude.loop.chunk_windows import CHUNK_FLAG, chunk_session, start_chunks
|
|
||||||
from loop_claude import tmux
|
|
||||||
from loop_claude.verdicts import Finished
|
|
||||||
from loop_claude.stop import Stop
|
from loop_claude.stop import Stop
|
||||||
from loop_claude.direct_message import tell
|
from loop_claude.direct_message import tell
|
||||||
|
from loop_claude import tmux
|
||||||
|
|
||||||
|
|
||||||
def main(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: pathlib.Path, cwd: pathlib.Path, effects: Effects) -> int:
|
def main(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher: pathlib.Path, cwd: pathlib.Path, effects: Effects) -> int:
|
||||||
|
|||||||
@@ -22,15 +22,13 @@ from routing_figures.calls import Call
|
|||||||
from loop_claude.project import checkout, model_choice, records
|
from loop_claude.project import checkout, model_choice, records
|
||||||
from loop_claude.cycle import chunk_items
|
from loop_claude.cycle import chunk_items
|
||||||
from loop_claude.loop import chunk_start, chunk_windows, close
|
from loop_claude.loop import chunk_start, chunk_windows, close
|
||||||
from loop_claude import tmux
|
|
||||||
from chunk_preflight import gathered
|
|
||||||
from touch_predictions.test_touch_predictions import plan as touch_plan
|
|
||||||
from project_config.test_project_config import configured
|
from project_config.test_project_config import configured
|
||||||
from release_plan.release_standing import DefaultPlan, LastCut, UNSEEN_RELEASES
|
from release_plan.release_standing import DefaultPlan, LastCut, UNSEEN_RELEASES
|
||||||
from loop_effects.effects import Effects, PYTHON_TIMEOUT
|
from loop_effects.effects import Effects, PYTHON_TIMEOUT
|
||||||
from claude_code import entries, reply, session
|
from claude_code import entries, reply, session
|
||||||
from failure import Failure
|
from failure import Failure
|
||||||
from loop_claude.verdicts import Finished, Interrupt, Judged, QuotedAnswer, TakenIn, Unfinished
|
from loop_claude.verdicts import Finished, Interrupt, Judged, QuotedAnswer, TakenIn, Unfinished
|
||||||
|
from chunk_preflight import gathered
|
||||||
from git_cli.git_repo import git
|
from git_cli.git_repo import git
|
||||||
from loop_claude.cycle import interrupt, judge, prompts, retry, run, spend, states, worker
|
from loop_claude.cycle import interrupt, judge, prompts, retry, run, spend, states, worker
|
||||||
from claude_code.reply import Limited
|
from claude_code.reply import Limited
|
||||||
@@ -45,7 +43,9 @@ from model_routing.route import Route, route_from, WorkerLine
|
|||||||
from loop_claude import routing
|
from loop_claude import routing
|
||||||
from model_routing.ladder import Rung
|
from model_routing.ladder import Rung
|
||||||
from loop_claude.stop import Stop
|
from loop_claude.stop import Stop
|
||||||
|
from loop_claude import tmux
|
||||||
from claude_code.tokens import Tokens, tokens_of
|
from claude_code.tokens import Tokens, tokens_of
|
||||||
|
from touch_predictions.test_touch_predictions import plan as touch_plan
|
||||||
from text_files.utc_stamp import utc
|
from text_files.utc_stamp import utc
|
||||||
from loop_claude.cycle.judge import verdict_from
|
from loop_claude.cycle.judge import verdict_from
|
||||||
|
|
||||||
|
|||||||
@@ -230,8 +230,9 @@ def load(top: pathlib.Path, main: pathlib.Path, home: pathlib.Path) -> ProjectCo
|
|||||||
]
|
]
|
||||||
if faults:
|
if faults:
|
||||||
return Failure(f"{file}: {'; '.join(faults)}. The settings are {', '.join(SETTINGS)}, and optionally {', '.join(OPTIONAL[:-1])} and {OPTIONAL[-1]}.")
|
return Failure(f"{file}: {'; '.join(faults)}. The settings are {', '.join(SETTINGS)}, and optionally {', '.join(OPTIONAL[:-1])} and {OPTIONAL[-1]}.")
|
||||||
# faults names a floor the config misspells, and a formula or bar a plan in Jira lacks or misspells.
|
# faults names a floor or a `parallel-chunks` value the config misspells, and a formula or bar a plan in Jira lacks or misspells.
|
||||||
assert floor is not None
|
assert floor is not None
|
||||||
|
assert isinstance(parallel, int)
|
||||||
assert scoring is not None or not epics["plan"]
|
assert scoring is not None or not epics["plan"]
|
||||||
return ProjectConfig(file.parent.name, file.parent, top, {name: path for name, path in paths.items() if path}, env_file, waits is True, on_host is True, floor, parallel, **{name.replace("-", "_"): str(values[name]) for name in checks if name in values}, epic=epics["plan"], goals_epic=epics["goals-and-audience"], notifier=notifier, jira_finish=Finish(*finish) if finish else None, jira_scoring=scoring, pages=pages)
|
return ProjectConfig(file.parent.name, file.parent, top, {name: path for name, path in paths.items() if path}, env_file, waits is True, on_host is True, floor, parallel, **{name.replace("-", "_"): str(values[name]) for name in checks if name in values}, epic=epics["plan"], goals_epic=epics["goals-and-audience"], notifier=notifier, jira_finish=Finish(*finish) if finish else None, jira_scoring=scoring, pages=pages)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user