context-rail 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {context_rail-0.2.2/src/context_rail.egg-info → context_rail-0.2.3}/PKG-INFO +1 -1
- {context_rail-0.2.2 → context_rail-0.2.3}/pyproject.toml +1 -1
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/cli.py +18 -14
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_planning.py +7 -8
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_risks.py +3 -2
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_roadmap.py +6 -4
- {context_rail-0.2.2 → context_rail-0.2.3/src/context_rail.egg-info}/PKG-INFO +1 -1
- {context_rail-0.2.2 → context_rail-0.2.3}/LICENSE +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/README.md +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/setup.cfg +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/__init__.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/__main__.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/__init__.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_contracts.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_drift.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_evidence_harvest.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_intent_match.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_pdca.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_rails.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_runs.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_runtime.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm/__init__.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm/_phase_drafts.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm/_plan_drafts.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm/drafts.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm_artifacts.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm_conductor.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm_core.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm_synthesis.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/context_pack.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/db.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/db_schema/__init__.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/db_schema/_gates.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/db_schema/_schema.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/db_schema.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/focus.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/gates.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/rules.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/__init__.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/_imports.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/_tool_surface.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_artifacts.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_autonomy.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_brainstorm.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_categories.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_configure.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_context.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_decisions.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_find.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_focus.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_gates.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_intent.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_lifecycle.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_notes.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_orient.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_phase_brainstorm.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_plan_review.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_projects.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_retro.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_rules.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_runtime.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_tasks.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/skills/daily/SKILL.md +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/skills/governance/SKILL.md +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/skills/orchestration/SKILL.md +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/skills/setup/SKILL.md +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/skills/wiki/SKILL.md +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail.egg-info/SOURCES.txt +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail.egg-info/dependency_links.txt +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail.egg-info/entry_points.txt +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail.egg-info/requires.txt +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail.egg-info/top_level.txt +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_agent_lanes.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_ambient_context.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_autonomy_drift.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_autonomy_record.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_brainstorm.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_brainstorm_tools.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_cli_agents.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_context_learning_loop.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_db.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_deps.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_evidence_harvest.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_evidence_validation.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_find.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_focus_tools.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_gates.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_governance_mode.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_governance_tiers.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_integration_lifecycle.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_intent_match.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_non_blocking_pdca.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_notes.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_orient.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_parallel_chat_safety.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_plan_review.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_project_create.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_retro.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_routing.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_runtime_check.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_runtime_integration.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_schema_invariants.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_smoke_v2.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_smoke_vibe.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_task_lifecycle.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_task_title_validation.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_tool_registry_integrity.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_tool_surface.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_usability_fixes.py +0 -0
- {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_web.py +0 -0
|
@@ -5,7 +5,7 @@ import json
|
|
|
5
5
|
import sys
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
|
-
from .db import DB_DIR, DB_PATH, STATE_PATH, get_db, init_db, load_state
|
|
8
|
+
from .db import DB_DIR, DB_PATH, STATE_PATH, get_db, init_db, load_state, resolve_workspace_project
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -86,8 +86,10 @@ def ensure_agents_md(project_id: str = "", project_name: str = "") -> None:
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
def _active_project_for_agents_md() -> tuple[str, str]:
|
|
89
|
-
|
|
90
|
-
project_id =
|
|
89
|
+
from pathlib import Path
|
|
90
|
+
project_id, _ = resolve_workspace_project(str(Path.cwd()))
|
|
91
|
+
if not project_id:
|
|
92
|
+
project_id = load_state().get("active_project_id", "")
|
|
91
93
|
if not project_id:
|
|
92
94
|
return "", ""
|
|
93
95
|
|
|
@@ -234,8 +236,10 @@ def cmd_doctor() -> int:
|
|
|
234
236
|
|
|
235
237
|
# --- 3. State ---
|
|
236
238
|
print("\nState:")
|
|
237
|
-
|
|
238
|
-
pid =
|
|
239
|
+
from pathlib import Path
|
|
240
|
+
pid, _ = resolve_workspace_project(str(Path.cwd()))
|
|
241
|
+
if not pid:
|
|
242
|
+
pid = load_state().get("active_project_id", "")
|
|
239
243
|
if pid:
|
|
240
244
|
ok(f"Active project: {pid}")
|
|
241
245
|
else:
|
|
@@ -337,8 +341,10 @@ def cmd_init() -> None:
|
|
|
337
341
|
print(" AGENTS.md: generated in current directory")
|
|
338
342
|
print(" Skills: context-rail skills installed to .agents/skills/")
|
|
339
343
|
else:
|
|
340
|
-
|
|
341
|
-
pid =
|
|
344
|
+
from pathlib import Path
|
|
345
|
+
pid, _ = resolve_workspace_project(str(Path.cwd()))
|
|
346
|
+
if not pid:
|
|
347
|
+
pid = load_state().get("active_project_id", "")
|
|
342
348
|
if pid:
|
|
343
349
|
proj = get_db().execute("SELECT name FROM projects WHERE id = ?", (pid,)).fetchone()
|
|
344
350
|
if proj:
|
|
@@ -441,14 +447,12 @@ def cmd_status(deleted: bool = False) -> None:
|
|
|
441
447
|
"SELECT COUNT(*) as cnt FROM projects WHERE deleted_at IS NOT NULL"
|
|
442
448
|
).fetchone()["cnt"]
|
|
443
449
|
conn.close()
|
|
444
|
-
state = load_state()
|
|
445
450
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
if
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
tid = state.get("active_task_id")
|
|
451
|
+
from pathlib import Path
|
|
452
|
+
pid, _ = resolve_workspace_project(str(Path.cwd()))
|
|
453
|
+
if not pid:
|
|
454
|
+
pid = load_state().get("active_project_id", "")
|
|
455
|
+
tid = load_state().get("active_task_id")
|
|
452
456
|
if pid:
|
|
453
457
|
proj = get_db().execute(
|
|
454
458
|
"SELECT name, deleted_at FROM projects WHERE id = ?", (pid,)
|
|
@@ -11,12 +11,13 @@ async def plan_goal(
|
|
|
11
11
|
priority: int = 0,
|
|
12
12
|
goal_type: str = "objective",
|
|
13
13
|
planned: bool = True,
|
|
14
|
+
workdir: str = "",
|
|
15
|
+
agent_id: str = "",
|
|
14
16
|
) -> str:
|
|
15
17
|
"""Add a goal to the current active phase."""
|
|
16
18
|
conn = get_db()
|
|
17
19
|
init_db(conn)
|
|
18
|
-
|
|
19
|
-
pid = state.get("active_project_id")
|
|
20
|
+
pid = resolve_pid_for_tool(workdir, agent_id) or load_state().get("active_project_id", "")
|
|
20
21
|
|
|
21
22
|
if not pid:
|
|
22
23
|
return "No active project."
|
|
@@ -39,12 +40,11 @@ async def plan_goal(
|
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
@mcp.tool()
|
|
42
|
-
async def plan_phase(name: str, target_date: str = "", sort_order: int = 0) -> str:
|
|
43
|
+
async def plan_phase(name: str, target_date: str = "", sort_order: int = 0, workdir: str = "", agent_id: str = "") -> str:
|
|
43
44
|
"""Add a new phase to the active project."""
|
|
44
45
|
conn = get_db()
|
|
45
46
|
init_db(conn)
|
|
46
|
-
|
|
47
|
-
pid = state.get("active_project_id")
|
|
47
|
+
pid = resolve_pid_for_tool(workdir, agent_id) or load_state().get("active_project_id", "")
|
|
48
48
|
|
|
49
49
|
if not pid:
|
|
50
50
|
return "No active project."
|
|
@@ -74,12 +74,11 @@ async def plan_phase(name: str, target_date: str = "", sort_order: int = 0) -> s
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
@mcp.tool()
|
|
77
|
-
async def phase_reorder(phase_id: str, new_sort_order: int) -> str:
|
|
77
|
+
async def phase_reorder(phase_id: str, new_sort_order: int, workdir: str = "", agent_id: str = "") -> str:
|
|
78
78
|
"""Move a phase to a new position. Other phases are rebalanced automatically."""
|
|
79
79
|
conn = get_db()
|
|
80
80
|
init_db(conn)
|
|
81
|
-
|
|
82
|
-
pid = state.get("active_project_id")
|
|
81
|
+
pid = resolve_pid_for_tool(workdir, agent_id) or load_state().get("active_project_id", "")
|
|
83
82
|
|
|
84
83
|
if not pid:
|
|
85
84
|
return "No active project."
|
|
@@ -10,6 +10,8 @@ async def risk(
|
|
|
10
10
|
severity: str = "medium",
|
|
11
11
|
description: str = "",
|
|
12
12
|
entity_type: str = "task",
|
|
13
|
+
workdir: str = "",
|
|
14
|
+
agent_id: str = "",
|
|
13
15
|
) -> str:
|
|
14
16
|
"""Flag a risk on a task or goal (severity: low|medium|high|critical)."""
|
|
15
17
|
conn = get_db()
|
|
@@ -38,8 +40,7 @@ async def risk(
|
|
|
38
40
|
# Auto-create enforcement rules for high/critical risks
|
|
39
41
|
derived_msg = ""
|
|
40
42
|
if severity in ("high", "critical"):
|
|
41
|
-
|
|
42
|
-
pid = state.get("active_project_id")
|
|
43
|
+
pid = resolve_pid_for_tool(workdir, agent_id) or load_state().get("active_project_id", "")
|
|
43
44
|
if pid:
|
|
44
45
|
# For critical: block retries; for high: warn on retries
|
|
45
46
|
action = "block" if severity == "critical" else "warn"
|
|
@@ -38,6 +38,8 @@ async def roadmap_add(
|
|
|
38
38
|
tags: str = "",
|
|
39
39
|
visibility: str = "team",
|
|
40
40
|
order_idx: int = 0,
|
|
41
|
+
workdir: str = "",
|
|
42
|
+
agent_id: str = "",
|
|
41
43
|
) -> str:
|
|
42
44
|
"""Create a new roadmap item.
|
|
43
45
|
|
|
@@ -49,8 +51,7 @@ async def roadmap_add(
|
|
|
49
51
|
|
|
50
52
|
conn = get_db()
|
|
51
53
|
init_db(conn)
|
|
52
|
-
|
|
53
|
-
pid = state.get("active_project_id")
|
|
54
|
+
pid = resolve_pid_for_tool(workdir, agent_id) or load_state().get("active_project_id", "")
|
|
54
55
|
if not pid:
|
|
55
56
|
conn.close()
|
|
56
57
|
return json.dumps({"error": "No active project"})
|
|
@@ -172,6 +173,8 @@ async def roadmap_list(
|
|
|
172
173
|
status: str = "",
|
|
173
174
|
parent_id: str = "",
|
|
174
175
|
visibility: str = "",
|
|
176
|
+
workdir: str = "",
|
|
177
|
+
agent_id: str = "",
|
|
175
178
|
) -> str:
|
|
176
179
|
"""List roadmap items with optional filters.
|
|
177
180
|
|
|
@@ -179,8 +182,7 @@ async def roadmap_list(
|
|
|
179
182
|
"""
|
|
180
183
|
conn = get_db()
|
|
181
184
|
init_db(conn)
|
|
182
|
-
|
|
183
|
-
pid = state.get("active_project_id")
|
|
185
|
+
pid = resolve_pid_for_tool(workdir, agent_id) or load_state().get("active_project_id", "")
|
|
184
186
|
if not pid:
|
|
185
187
|
conn.close()
|
|
186
188
|
return json.dumps({"error": "No active project"})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|