throughline 3.19.2__tar.gz → 3.19.4__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 (76) hide show
  1. {throughline-3.19.2/src/throughline.egg-info → throughline-3.19.4}/PKG-INFO +2 -2
  2. {throughline-3.19.2 → throughline-3.19.4}/README.md +1 -1
  3. {throughline-3.19.2 → throughline-3.19.4}/pyproject.toml +1 -1
  4. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/apply.py +17 -1
  5. {throughline-3.19.2 → throughline-3.19.4/src/throughline.egg-info}/PKG-INFO +2 -2
  6. {throughline-3.19.2 → throughline-3.19.4}/tests/test_apply.py +67 -0
  7. {throughline-3.19.2 → throughline-3.19.4}/LICENSE +0 -0
  8. {throughline-3.19.2 → throughline-3.19.4}/NOTICE +0 -0
  9. {throughline-3.19.2 → throughline-3.19.4}/setup.cfg +0 -0
  10. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/__init__.py +0 -0
  11. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/brief.py +0 -0
  12. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/cli.py +0 -0
  13. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/collision.py +0 -0
  14. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/composition.py +0 -0
  15. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/diagrams.py +0 -0
  16. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/dump.py +0 -0
  17. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/filters.py +0 -0
  18. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/fingerprint.py +0 -0
  19. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/graph.py +0 -0
  20. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/grounding.py +0 -0
  21. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/identity.py +0 -0
  22. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/inject.py +0 -0
  23. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/items.py +0 -0
  24. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/links.py +0 -0
  25. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/model.py +0 -0
  26. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/parser.py +0 -0
  27. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/ratification.py +0 -0
  28. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/resolvers.py +0 -0
  29. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/schema.py +0 -0
  30. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/schema_ops.py +0 -0
  31. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/seam.py +0 -0
  32. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/signed_links.py +0 -0
  33. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/sources.py +0 -0
  34. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/storage.py +0 -0
  35. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/tomledit.py +0 -0
  36. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/uid.py +0 -0
  37. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/union.py +0 -0
  38. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/validate.py +0 -0
  39. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/version.py +0 -0
  40. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/views.py +0 -0
  41. {throughline-3.19.2 → throughline-3.19.4}/src/throughline/worklist.py +0 -0
  42. {throughline-3.19.2 → throughline-3.19.4}/src/throughline.egg-info/SOURCES.txt +0 -0
  43. {throughline-3.19.2 → throughline-3.19.4}/src/throughline.egg-info/dependency_links.txt +0 -0
  44. {throughline-3.19.2 → throughline-3.19.4}/src/throughline.egg-info/entry_points.txt +0 -0
  45. {throughline-3.19.2 → throughline-3.19.4}/src/throughline.egg-info/requires.txt +0 -0
  46. {throughline-3.19.2 → throughline-3.19.4}/src/throughline.egg-info/top_level.txt +0 -0
  47. {throughline-3.19.2 → throughline-3.19.4}/tests/test_amend.py +0 -0
  48. {throughline-3.19.2 → throughline-3.19.4}/tests/test_baseline.py +0 -0
  49. {throughline-3.19.2 → throughline-3.19.4}/tests/test_clarify.py +0 -0
  50. {throughline-3.19.2 → throughline-3.19.4}/tests/test_deprecated_names.py +0 -0
  51. {throughline-3.19.2 → throughline-3.19.4}/tests/test_diagram_cli.py +0 -0
  52. {throughline-3.19.2 → throughline-3.19.4}/tests/test_doctor.py +0 -0
  53. {throughline-3.19.2 → throughline-3.19.4}/tests/test_engine.py +0 -0
  54. {throughline-3.19.2 → throughline-3.19.4}/tests/test_filters.py +0 -0
  55. {throughline-3.19.2 → throughline-3.19.4}/tests/test_flag.py +0 -0
  56. {throughline-3.19.2 → throughline-3.19.4}/tests/test_library_api.py +0 -0
  57. {throughline-3.19.2 → throughline-3.19.4}/tests/test_link_guard.py +0 -0
  58. {throughline-3.19.2 → throughline-3.19.4}/tests/test_normative_by_type.py +0 -0
  59. {throughline-3.19.2 → throughline-3.19.4}/tests/test_own_tree.py +0 -0
  60. {throughline-3.19.2 → throughline-3.19.4}/tests/test_ratification_change.py +0 -0
  61. {throughline-3.19.2 → throughline-3.19.4}/tests/test_ratification_withdrawal.py +0 -0
  62. {throughline-3.19.2 → throughline-3.19.4}/tests/test_ratified_content.py +0 -0
  63. {throughline-3.19.2 → throughline-3.19.4}/tests/test_ratifier_correction.py +0 -0
  64. {throughline-3.19.2 → throughline-3.19.4}/tests/test_ratify_several.py +0 -0
  65. {throughline-3.19.2 → throughline-3.19.4}/tests/test_ratify_status.py +0 -0
  66. {throughline-3.19.2 → throughline-3.19.4}/tests/test_ratify_transition_refused_first.py +0 -0
  67. {throughline-3.19.2 → throughline-3.19.4}/tests/test_register_type.py +0 -0
  68. {throughline-3.19.2 → throughline-3.19.4}/tests/test_resolve_collision.py +0 -0
  69. {throughline-3.19.2 → throughline-3.19.4}/tests/test_resolve_cross_graph.py +0 -0
  70. {throughline-3.19.2 → throughline-3.19.4}/tests/test_schema_ops.py +0 -0
  71. {throughline-3.19.2 → throughline-3.19.4}/tests/test_signed_links.py +0 -0
  72. {throughline-3.19.2 → throughline-3.19.4}/tests/test_spec_lists.py +0 -0
  73. {throughline-3.19.2 → throughline-3.19.4}/tests/test_tombstone_record.py +0 -0
  74. {throughline-3.19.2 → throughline-3.19.4}/tests/test_unset_attrs.py +0 -0
  75. {throughline-3.19.2 → throughline-3.19.4}/tests/test_worklist.py +0 -0
  76. {throughline-3.19.2 → throughline-3.19.4}/tests/test_yaml_loader.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: throughline
3
- Version: 3.19.2
3
+ Version: 3.19.4
4
4
  Summary: A Git-native requirements management tool with a scope-avalanche grounding layer: permanent UIDs, one file per item, typed links, suspect detection, and a CI-gating check.
5
5
  Author-email: Henry J Grech-Cini <henry.grechcini@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -36,7 +36,7 @@ version control; a `check` command validates the whole graph and gates CI.
36
36
 
37
37
  **Dogfooded:** throughline's own spec is itself a throughline project —
38
38
  <!-- tl:count type == 'system_requirement' -->
39
- 218
39
+ 219
40
40
  <!-- tl:end --> system requirements,
41
41
  <!-- tl:count type == 'user_requirement' -->
42
42
  35
@@ -8,7 +8,7 @@ version control; a `check` command validates the whole graph and gates CI.
8
8
 
9
9
  **Dogfooded:** throughline's own spec is itself a throughline project —
10
10
  <!-- tl:count type == 'system_requirement' -->
11
- 218
11
+ 219
12
12
  <!-- tl:end --> system requirements,
13
13
  <!-- tl:count type == 'user_requirement' -->
14
14
  35
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "throughline"
7
- version = "3.19.2"
7
+ version = "3.19.4"
8
8
  description = "A Git-native requirements management tool with a scope-avalanche grounding layer: permanent UIDs, one file per item, typed links, suspect detection, and a CI-gating check."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -39,7 +39,7 @@ from pathlib import Path
39
39
  from typing import Callable
40
40
 
41
41
  from .fingerprint import fingerprint, revision
42
- from .grounding import GroundingError
42
+ from .grounding import GroundingError, set_status
43
43
  from .items import amend_item, delete_item, item_type_for, new_item, parse_attrs
44
44
  from .links import GroundingView, LinkError, add_link, remove_link
45
45
  from .model import Item, Link
@@ -418,11 +418,26 @@ def apply_change_set(project, operations: list[dict], *,
418
418
  def resolve(ref: str) -> str:
419
419
  return labels[ref[1:]] if _is_label(ref) else ref
420
420
 
421
+ roles = schema.status_roles or {}
422
+ initial, proposed = roles.get("initial"), roles.get("proposed")
423
+
424
+ def put_forward(item: Item) -> None:
425
+ """Move an item the set changed out of the initial status into proposed,
426
+ as an item the set creates is born (SR-0252): machine-authored content
427
+ waits as proposed. Only from the initial status, and only where the
428
+ project's lifecycle has that move — an item a person has already moved
429
+ on keeps its place, and the set never writes a transition the project
430
+ forbids."""
431
+ if (initial and proposed and item.status == initial
432
+ and schema.allows_transition(initial, proposed)):
433
+ set_status(schema, item, proposed)
434
+
421
435
  def mark_changed(item: Item) -> None:
422
436
  """Record that the set changed this item (SR-0252): it carries the machine
423
437
  origin, so the gate asks a person before it counts (SR-0092)."""
424
438
  if item.attrs.get("origin") != ai:
425
439
  item.attrs["origin"] = ai
440
+ put_forward(item)
426
441
  write_item(item, project.register_of(item.uid))
427
442
  if item.uid not in changed and item.uid not in created:
428
443
  changed.append(item.uid)
@@ -459,6 +474,7 @@ def apply_change_set(project, operations: list[dict], *,
459
474
  outcome = amend_item(project, uid, title=op.get("title"),
460
475
  text=op.get("text"), rationale=op.get("rationale"),
461
476
  attrs=attrs, unset=op.get("unset", ()))
477
+ put_forward(item)
462
478
  write_item(item, project.register_of(uid))
463
479
  if uid not in changed and uid not in created:
464
480
  changed.append(uid)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: throughline
3
- Version: 3.19.2
3
+ Version: 3.19.4
4
4
  Summary: A Git-native requirements management tool with a scope-avalanche grounding layer: permanent UIDs, one file per item, typed links, suspect detection, and a CI-gating check.
5
5
  Author-email: Henry J Grech-Cini <henry.grechcini@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -36,7 +36,7 @@ version control; a `check` command validates the whole graph and gates CI.
36
36
 
37
37
  **Dogfooded:** throughline's own spec is itself a throughline project —
38
38
  <!-- tl:count type == 'system_requirement' -->
39
- 218
39
+ 219
40
40
  <!-- tl:end --> system requirements,
41
41
  <!-- tl:count type == 'user_requirement' -->
42
42
  35
@@ -343,3 +343,70 @@ def test_format_2_takes_only_the_revision_and_format_1_only_the_fingerprint(tmp_
343
343
  with pytest.raises(ChangeSetError) as e:
344
344
  parse_change_set(json.dumps(data))
345
345
  assert any(expected in p for p in e.value.problems), (expected, e.value.problems)
346
+
347
+
348
+ # --------------------------------------------------------------------------- #
349
+ # An item the set changes is put forward as proposed, as one it creates is born.
350
+ # --------------------------------------------------------------------------- #
351
+
352
+
353
+ def _status_of(root: Path, uid: str) -> str:
354
+ return _item(root, uid).status
355
+
356
+
357
+ def test_an_amended_draft_item_is_put_forward_as_proposed(tmp_path, capsys):
358
+ root = _scaffold(tmp_path)
359
+ assert _status_of(root, "FR-0001") == "draft"
360
+ path = _set(root, [{"op": "amend", "uid": "FR-0001", "revision": _rev(root, "FR-0001"),
361
+ "text": "rewritten by an assistant"}])
362
+ assert _cli(["-C", str(root), "apply", str(path)]) == 0
363
+ assert _status_of(root, "FR-0001") == "proposed"
364
+ capsys.readouterr()
365
+ _cli(["-C", str(root), "check"])
366
+ out = capsys.readouterr().out
367
+ assert "FR-0001" in out and "awaiting human ratification" in out
368
+ assert "never proposed" not in out
369
+
370
+
371
+ def test_a_draft_item_given_a_link_or_losing_one_is_put_forward_as_proposed(tmp_path):
372
+ root = _scaffold(tmp_path)
373
+ assert _cli(["-C", str(root), "new", "FR", "--type", "requirement", "--title", "other",
374
+ "--ground", "INT-0001"]) == 0
375
+ assert _cli(["-C", str(root), "link", "FR-0002", "INT-0001", "--type", "relates"]) == 0
376
+ path = _set(root, [{"op": "link", "uid": "FR-0001", "revision": _rev(root, "FR-0001"),
377
+ "target": "FR-0002", "type": "relates"},
378
+ {"op": "unlink", "uid": "FR-0002", "revision": _rev(root, "FR-0002"),
379
+ "target": "INT-0001", "type": "relates"}])
380
+ apply_change_set(load_project(root), parse_change_set(path.read_text(encoding="utf-8")))
381
+ assert _status_of(root, "FR-0001") == "proposed"
382
+ assert _status_of(root, "FR-0002") == "proposed"
383
+
384
+
385
+ def test_a_draft_item_stays_draft_where_the_lifecycle_has_no_move_to_proposed(tmp_path):
386
+ root = _scaffold(tmp_path)
387
+ config = root / "throughline.toml"
388
+ text = config.read_text(encoding="utf-8")
389
+ config.write_text(text.replace(
390
+ 'draft = ["proposed", "approved",', 'draft = ["approved",'), encoding="utf-8")
391
+ path = _set(root, [{"op": "amend", "uid": "FR-0001", "revision": _rev(root, "FR-0001"),
392
+ "text": "rewritten by an assistant"}])
393
+ assert _cli(["-C", str(root), "apply", str(path)]) == 0
394
+ first = _item(root, "FR-0001")
395
+ assert first.status == "draft" and first.attrs["origin"] == "ai"
396
+
397
+
398
+ def test_an_item_past_draft_keeps_its_status_when_the_set_changes_it(tmp_path):
399
+ root = _scaffold(tmp_path)
400
+ assert _cli(["-C", str(root), "status", "FR-0001", "approved"]) == 0
401
+ path = _set(root, [{"op": "amend", "uid": "FR-0001", "revision": _rev(root, "FR-0001"),
402
+ "text": "rewritten by an assistant"}])
403
+ assert _cli(["-C", str(root), "apply", str(path)]) == 0
404
+ assert _status_of(root, "FR-0001") == "approved"
405
+
406
+
407
+ def test_a_dry_run_puts_nothing_forward(tmp_path):
408
+ root = _scaffold(tmp_path)
409
+ path = _set(root, [{"op": "amend", "uid": "FR-0001", "revision": _rev(root, "FR-0001"),
410
+ "text": "rewritten by an assistant"}])
411
+ assert _cli(["-C", str(root), "apply", str(path), "--dry-run"]) == 0
412
+ assert _status_of(root, "FR-0001") == "draft"
File without changes
File without changes
File without changes