feat(RMGR-WP-0008): add workplan and register receiving surfaces

This commit is contained in:
tegwick 2026-08-21 17:15:21 +02:00
parent 5502afc1fd
commit 859df9aae7
15 changed files with 1501 additions and 11 deletions

View file

@ -9,6 +9,7 @@ import yaml
from repo_manager.gitops import head_sha, is_git_repo
from repo_manager.index_store import RepoIndex, WorkRecordEntry, _now
from repo_manager.parse.register import iter_register_files, parse_register_file
from repo_manager.parse.workplan import iter_workplan_files, parse_workplan_file
@ -72,6 +73,19 @@ def observe_repository(repo_root: Path, *, slug: str | None = None) -> tuple[dic
)
)
for path in iter_register_files(repo_root):
for entry in parse_register_file(path, repo_root=repo_root):
records.append(
WorkRecordEntry(
kind=f"register:{entry.kind}",
id=entry.id,
status=entry.status,
title=entry.title,
source_path=entry.source_path,
extra={"register_kind": entry.kind, "entry": entry.raw},
)
)
sha = head_sha(repo_root) if is_git_repo(repo_root) else None
index = RepoIndex(
slug=slug,
@ -101,6 +115,7 @@ def observe_repository(repo_root: Path, *, slug: str | None = None) -> tuple[dic
"index": {
"workplan_count": sum(1 for r in records if r.kind == "workplan"),
"task_count": sum(1 for r in records if r.kind == "task"),
"register_entry_count": sum(1 for r in records if r.kind.startswith("register:")),
"record_count": len(records),
},
}