docs: add task for agent prompt generation
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ Current Stage: BUILDING
|
||||
Previous Stage: BOOTSTRAP_READY
|
||||
Next Stage: REVIEW_READY
|
||||
|
||||
Current Task: TASK-003
|
||||
Current Task: TASK-004
|
||||
Active Branch: main
|
||||
|
||||
Last Updated: 2026-06-02
|
||||
|
||||
@@ -40,7 +40,7 @@ Acceptance Criteria:
|
||||
|
||||
## TASK-003 — Improve discovery workflow
|
||||
|
||||
Status: Todo
|
||||
Status: Done
|
||||
|
||||
Goal:
|
||||
Improve `rdb discover` so it records structured answers into the discovery ledger.
|
||||
@@ -60,3 +60,15 @@ Acceptance Criteria:
|
||||
- Preserve existing discovery history
|
||||
- Add/update tests
|
||||
- Update RUN_LOG.md
|
||||
|
||||
## TASK-004 — Implement ask-more command
|
||||
|
||||
Status: Todo
|
||||
|
||||
Goal: Add a command that finds weak answers and asks deeper follow-up questions.
|
||||
|
||||
Acceptance Criteria:
|
||||
|
||||
- command reads discovery-log.md
|
||||
- low-confidence answers are detected
|
||||
- follow-up answers are appended to discovery-log.md
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
from pathlib import Path
|
||||
|
||||
import rdb_discovery.discovery as discovery_mod
|
||||
|
||||
|
||||
def test_core_questions_returns_10_items() -> None:
|
||||
questions = discovery_mod.core_questions()
|
||||
assert len(questions) == 10
|
||||
|
||||
|
||||
def test_append_creates_file_when_missing(tmp_path: Path) -> None:
|
||||
log_path = tmp_path / "context" / "discovery-log.md"
|
||||
assert not log_path.exists()
|
||||
|
||||
discovery_mod.append_discovery_answer(
|
||||
tmp_path,
|
||||
question_id="Q-001",
|
||||
question="What problem are we solving?",
|
||||
answer="A great app",
|
||||
confidence="High",
|
||||
follow_up_needed="No",
|
||||
)
|
||||
|
||||
assert log_path.exists()
|
||||
|
||||
|
||||
def test_append_records_all_fields(tmp_path: Path) -> None:
|
||||
discovery_mod.append_discovery_answer(
|
||||
tmp_path,
|
||||
question_id="Q-001",
|
||||
question="What problem are we solving?",
|
||||
answer="A great app",
|
||||
confidence="High",
|
||||
follow_up_needed="No",
|
||||
)
|
||||
|
||||
content = (tmp_path / "context" / "discovery-log.md").read_text(encoding="utf-8")
|
||||
assert "| Q-001 |" in content
|
||||
assert "What problem are we solving?" in content
|
||||
assert "A great app" in content
|
||||
assert "High" in content
|
||||
assert "No" in content
|
||||
|
||||
|
||||
def test_append_escapes_pipe_in_answer(tmp_path: Path) -> None:
|
||||
discovery_mod.append_discovery_answer(
|
||||
tmp_path,
|
||||
question_id="Q-001",
|
||||
question="What | is this?",
|
||||
answer="A | B",
|
||||
confidence="High",
|
||||
follow_up_needed="No",
|
||||
)
|
||||
|
||||
content = (tmp_path / "context" / "discovery-log.md").read_text(encoding="utf-8")
|
||||
# Piped answers should be escaped so the table row doesn't break
|
||||
assert "\\|" in content
|
||||
|
||||
|
||||
def test_append_escapes_newline_in_answer(tmp_path: Path) -> None:
|
||||
discovery_mod.append_discovery_answer(
|
||||
tmp_path,
|
||||
question_id="Q-001",
|
||||
question="Multi\nline?",
|
||||
answer="A\nB\nC",
|
||||
confidence="High",
|
||||
follow_up_needed="No",
|
||||
)
|
||||
|
||||
content = (tmp_path / "context" / "discovery-log.md").read_text(encoding="utf-8")
|
||||
# Data rows should each be a single line — no embedded newlines
|
||||
data_lines = [l for l in content.splitlines() if l.startswith("| Q-")]
|
||||
assert len(data_lines) == 1
|
||||
assert "\n" not in data_lines[0]
|
||||
|
||||
|
||||
def test_append_preserves_existing_history(tmp_path: Path) -> None:
|
||||
log_path = tmp_path / "context" / "discovery-log.md"
|
||||
|
||||
discovery_mod.append_discovery_answer(
|
||||
tmp_path,
|
||||
question_id="Q-001",
|
||||
question="First?",
|
||||
answer="Ans 1",
|
||||
confidence="High",
|
||||
follow_up_needed="No",
|
||||
)
|
||||
|
||||
assert log_path.read_text(encoding="utf-8").count("Ans 1") == 1
|
||||
|
||||
discovery_mod.append_discovery_answer(
|
||||
tmp_path,
|
||||
question_id="Q-002",
|
||||
question="Second?",
|
||||
answer="Ans 2",
|
||||
confidence="Low",
|
||||
follow_up_needed="Yes",
|
||||
)
|
||||
|
||||
content = log_path.read_text(encoding="utf-8")
|
||||
assert "Ans 1" in content
|
||||
assert "Ans 2" in content
|
||||
# Two data rows, not one
|
||||
data_rows = [l for l in content.splitlines() if l.startswith("| Q-")]
|
||||
assert len(data_rows) == 2
|
||||
|
||||
|
||||
def test_header_is_written_on_create(tmp_path: Path) -> None:
|
||||
discovery_mod.append_discovery_answer(
|
||||
tmp_path,
|
||||
question_id="Q-001",
|
||||
question="Test?",
|
||||
answer="T",
|
||||
confidence="High",
|
||||
follow_up_needed="No",
|
||||
)
|
||||
|
||||
content = (tmp_path / "context" / "discovery-log.md").read_text(encoding="utf-8")
|
||||
assert "# Discovery Log" in content
|
||||
assert "| ID | Question | Answer | Confidence | Follow-up needed | Linked decision | Linked task | Date |" in content
|
||||
Reference in New Issue
Block a user