amazon-science/ammo / ai_cli_session/.codex/skills/ammo
ammo
UnverifiedProfile and optimize GPU kernels for vLLM inference on NVIDIA GPUs. Use when targeting a specific model, hardware, dtype, parallelism, and workload to improve latency.
tests/test_resolve_codex_transcript.py
View on GitHub# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: CC-BY-NC-4.0
from __future__ import annotations
import sqlite3
import sys
from pathlib import Path
import pytest
SCRIPTS = Path(__file__).resolve().parent.parent / "scripts"
if str(SCRIPTS) not in sys.path:
sys.path.insert(0, str(SCRIPTS))
from resolve_codex_transcript import resolve_transcript
def _db(tmp_path: Path) -> Path:
path = tmp_path / "state.sqlite"
connection = sqlite3.connect(path)
connection.executescript(
"""
CREATE TABLE threads (
id TEXT PRIMARY KEY,
rollout_path TEXT NOT NULL,
agent_path TEXT,
created_at_ms INTEGER
);
CREATE TABLE thread_spawn_edges (
parent_thread_id TEXT NOT NULL,
child_thread_id TEXT PRIMARY KEY,
status TEXT NOT NULL
);
"""
)
connection.close()
return path
def _insert(db: Path, *, parent: str, child: str, agent_path: str, transcript: Path, created: int):
transcript.write_text('{"type":"session_meta"}\n', encoding="utf-8")
connection = sqlite3.connect(db)
connection.execute(
"INSERT INTO threads VALUES (?, ?, ?, ?)",
(child, str(transcript), agent_path, created),
)
connection.execute(
"INSERT INTO thread_spawn_edges VALUES (?, ?, 'open')",
(parent, child),
)
connection.commit()
connection.close()
def test_resolves_newest_exact_child_and_bounded_replacement_paths(tmp_path: Path):
db = _db(tmp_path)
parent = "campaign-uuid"
old = tmp_path / "old.jsonl"
new = tmp_path / "new.jsonl"
other = tmp_path / "other.jsonl"
_insert(db, parent=parent, child="old-id", agent_path="/root/impl_op007", transcript=old, created=1)
_insert(db, parent=parent, child="new-id", agent_path="/root/impl_op007", transcript=new, created=2)
_insert(db, parent=parent, child="other-id", agent_path="/root/impl_op008", transcript=other, created=3)
result = resolve_transcript(db, parent, "/root/impl_op007")
assert result["target_rollout_id"] == "new-id"
assert result["target_transcript_path"] == str(new.resolve())
assert result["collision_candidate_paths"] == [str(new.resolve()), str(old.resolve())]
assert str(other.resolve()) not in result["collision_candidate_paths"]
def test_fails_closed_when_exact_child_has_no_readable_transcript(tmp_path: Path):
db = _db(tmp_path)
connection = sqlite3.connect(db)
connection.execute(
"INSERT INTO threads VALUES (?, ?, ?, ?)",
("child", str(tmp_path / "missing.jsonl"), "/root/impl_op007", 1),
)
connection.execute(
"INSERT INTO thread_spawn_edges VALUES (?, ?, 'open')",
("campaign", "child"),
)
connection.commit()
connection.close()
with pytest.raises(LookupError, match="No readable child transcript"):
resolve_transcript(db, "campaign", "/root/impl_op007")
def test_rejects_noncanonical_agent_path(tmp_path: Path):
with pytest.raises(ValueError, match="canonical absolute"):
resolve_transcript(_db(tmp_path), "campaign", "impl_op007")
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |