INNER CODE UNIT · Python

skill_status

faridrashidi/cnsplots · src/cnsplots/_cli.py:261

def skill_status(agent: str, *, base_dir: Path) -> tuple[_SkillStatus, ...]:
    """Inspect selected paths without writes; unrelated files do not affect matches.

    States are missing, unmanaged (no manifest), modified (managed files changed
    or missing), outdated (unchanged but differs from this package), and current.
    """
    destinations = _destinations(agent, base_dir)
    hashes = {name: _digest(content) for name, content in _packaged_files().items()}
    statuses = []
    for name, destination in destinations:
        if not destination.exists():
            statuses.append(_SkillStatus(name, destination, "missing", None, None))
            continue
        manifest = _read_manifest(destination)
        installed = {name: _file_digest(destination, name) for name in hashes}
        matches = installed == hashes
        state = "unmanaged"
        version = None

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…