mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-03 20:24:49 +08:00
feat: Python porting workspace with reference data and parity audit
This commit is contained in:
49
src/models.py
Normal file
49
src/models.py
Normal file
@@ -0,0 +1,49 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Subsystem:
|
||||
name: str
|
||||
path: str
|
||||
file_count: int
|
||||
notes: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class PortingModule:
|
||||
name: str
|
||||
responsibility: str
|
||||
source_hint: str
|
||||
status: str = 'planned'
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class PermissionDenial:
|
||||
tool_name: str
|
||||
reason: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class UsageSummary:
|
||||
input_tokens: int = 0
|
||||
output_tokens: int = 0
|
||||
|
||||
def add_turn(self, prompt: str, output: str) -> 'UsageSummary':
|
||||
return UsageSummary(
|
||||
input_tokens=self.input_tokens + len(prompt.split()),
|
||||
output_tokens=self.output_tokens + len(output.split()),
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
class PortingBacklog:
|
||||
title: str
|
||||
modules: list[PortingModule] = field(default_factory=list)
|
||||
|
||||
def summary_lines(self) -> list[str]:
|
||||
return [
|
||||
f'- {module.name} [{module.status}] — {module.responsibility} (from {module.source_hint})'
|
||||
for module in self.modules
|
||||
]
|
||||
Reference in New Issue
Block a user