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.
Files changed (112) hide show
  1. {context_rail-0.2.2/src/context_rail.egg-info → context_rail-0.2.3}/PKG-INFO +1 -1
  2. {context_rail-0.2.2 → context_rail-0.2.3}/pyproject.toml +1 -1
  3. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/cli.py +18 -14
  4. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_planning.py +7 -8
  5. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_risks.py +3 -2
  6. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_roadmap.py +6 -4
  7. {context_rail-0.2.2 → context_rail-0.2.3/src/context_rail.egg-info}/PKG-INFO +1 -1
  8. {context_rail-0.2.2 → context_rail-0.2.3}/LICENSE +0 -0
  9. {context_rail-0.2.2 → context_rail-0.2.3}/README.md +0 -0
  10. {context_rail-0.2.2 → context_rail-0.2.3}/setup.cfg +0 -0
  11. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/__init__.py +0 -0
  12. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/__main__.py +0 -0
  13. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/__init__.py +0 -0
  14. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_contracts.py +0 -0
  15. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_drift.py +0 -0
  16. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_evidence_harvest.py +0 -0
  17. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_intent_match.py +0 -0
  18. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_pdca.py +0 -0
  19. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_rails.py +0 -0
  20. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_runs.py +0 -0
  21. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy/_runtime.py +0 -0
  22. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/autonomy.py +0 -0
  23. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm/__init__.py +0 -0
  24. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm/_phase_drafts.py +0 -0
  25. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm/_plan_drafts.py +0 -0
  26. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm/drafts.py +0 -0
  27. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm_artifacts.py +0 -0
  28. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm_conductor.py +0 -0
  29. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm_core.py +0 -0
  30. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/brainstorm_synthesis.py +0 -0
  31. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/context_pack.py +0 -0
  32. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/db.py +0 -0
  33. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/db_schema/__init__.py +0 -0
  34. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/db_schema/_gates.py +0 -0
  35. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/db_schema/_schema.py +0 -0
  36. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/db_schema.py +0 -0
  37. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/focus.py +0 -0
  38. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/gates.py +0 -0
  39. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/rules.py +0 -0
  40. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/__init__.py +0 -0
  41. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/_imports.py +0 -0
  42. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/_tool_surface.py +0 -0
  43. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_artifacts.py +0 -0
  44. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_autonomy.py +0 -0
  45. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_brainstorm.py +0 -0
  46. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_categories.py +0 -0
  47. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_configure.py +0 -0
  48. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_context.py +0 -0
  49. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_decisions.py +0 -0
  50. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_find.py +0 -0
  51. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_focus.py +0 -0
  52. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_gates.py +0 -0
  53. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_intent.py +0 -0
  54. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_lifecycle.py +0 -0
  55. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_notes.py +0 -0
  56. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_orient.py +0 -0
  57. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_phase_brainstorm.py +0 -0
  58. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_plan_review.py +0 -0
  59. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_projects.py +0 -0
  60. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_retro.py +0 -0
  61. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_rules.py +0 -0
  62. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_runtime.py +0 -0
  63. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server/tools_tasks.py +0 -0
  64. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/server.py +0 -0
  65. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/skills/daily/SKILL.md +0 -0
  66. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/skills/governance/SKILL.md +0 -0
  67. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/skills/orchestration/SKILL.md +0 -0
  68. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/skills/setup/SKILL.md +0 -0
  69. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail/skills/wiki/SKILL.md +0 -0
  70. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail.egg-info/SOURCES.txt +0 -0
  71. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail.egg-info/dependency_links.txt +0 -0
  72. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail.egg-info/entry_points.txt +0 -0
  73. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail.egg-info/requires.txt +0 -0
  74. {context_rail-0.2.2 → context_rail-0.2.3}/src/context_rail.egg-info/top_level.txt +0 -0
  75. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_agent_lanes.py +0 -0
  76. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_ambient_context.py +0 -0
  77. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_autonomy_drift.py +0 -0
  78. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_autonomy_record.py +0 -0
  79. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_brainstorm.py +0 -0
  80. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_brainstorm_tools.py +0 -0
  81. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_cli_agents.py +0 -0
  82. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_context_learning_loop.py +0 -0
  83. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_db.py +0 -0
  84. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_deps.py +0 -0
  85. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_evidence_harvest.py +0 -0
  86. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_evidence_validation.py +0 -0
  87. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_find.py +0 -0
  88. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_focus_tools.py +0 -0
  89. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_gates.py +0 -0
  90. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_governance_mode.py +0 -0
  91. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_governance_tiers.py +0 -0
  92. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_integration_lifecycle.py +0 -0
  93. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_intent_match.py +0 -0
  94. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_non_blocking_pdca.py +0 -0
  95. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_notes.py +0 -0
  96. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_orient.py +0 -0
  97. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_parallel_chat_safety.py +0 -0
  98. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_plan_review.py +0 -0
  99. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_project_create.py +0 -0
  100. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_retro.py +0 -0
  101. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_routing.py +0 -0
  102. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_runtime_check.py +0 -0
  103. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_runtime_integration.py +0 -0
  104. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_schema_invariants.py +0 -0
  105. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_smoke_v2.py +0 -0
  106. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_smoke_vibe.py +0 -0
  107. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_task_lifecycle.py +0 -0
  108. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_task_title_validation.py +0 -0
  109. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_tool_registry_integrity.py +0 -0
  110. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_tool_surface.py +0 -0
  111. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_usability_fixes.py +0 -0
  112. {context_rail-0.2.2 → context_rail-0.2.3}/tests/test_web.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: context-rail
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Context Rail — agentic task-management that keeps your project on rails.
5
5
  License: MIT
6
6
  Project-URL: Repository, https://github.com/nguyenhoanhson797/Context-Rail
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "context-rail"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Context Rail — agentic task-management that keeps your project on rails."
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -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
- state = load_state()
90
- project_id = state.get("active_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
- state = load_state()
238
- pid = state.get("active_project_id")
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
- state = load_state()
341
- pid = state.get("active_project_id")
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
- print(f"DB: {DB_PATH}")
447
- print(f"Projects: {active_count} active")
448
- if deleted_count > 0:
449
- print(f" {deleted_count} soft-deleted (use --deleted to list)")
450
- pid = state.get("active_project_id")
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
- state = load_state()
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
- state = load_state()
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
- state = load_state()
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
- state = load_state()
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
- state = load_state()
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
- state = load_state()
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"})
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: context-rail
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Context Rail — agentic task-management that keeps your project on rails.
5
5
  License: MIT
6
6
  Project-URL: Repository, https://github.com/nguyenhoanhson797/Context-Rail
File without changes
File without changes
File without changes