scriptoria 0.8.0__tar.gz → 0.8.1__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 (50) hide show
  1. {scriptoria-0.8.0 → scriptoria-0.8.1}/.gitignore +4 -0
  2. {scriptoria-0.8.0 → scriptoria-0.8.1}/PKG-INFO +1 -1
  3. {scriptoria-0.8.0 → scriptoria-0.8.1}/pyproject.toml +1 -1
  4. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/__init__.py +1 -1
  5. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/facts.py +14 -1
  6. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_facts.py +14 -0
  7. {scriptoria-0.8.0 → scriptoria-0.8.1}/uv.lock +1 -1
  8. {scriptoria-0.8.0 → scriptoria-0.8.1}/README.md +0 -0
  9. {scriptoria-0.8.0 → scriptoria-0.8.1}/pyrightconfig.json +0 -0
  10. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/anchors.py +0 -0
  11. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/blocks.py +0 -0
  12. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/cli.py +0 -0
  13. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/embeddings.py +0 -0
  14. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/errors.py +0 -0
  15. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/frontmatter.py +0 -0
  16. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/graph.py +0 -0
  17. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/hashing.py +0 -0
  18. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/ingest.py +0 -0
  19. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/lock.py +0 -0
  20. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/manifest.py +0 -0
  21. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/pageindex_adapter.py +0 -0
  22. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/query.py +0 -0
  23. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/retrieval.py +0 -0
  24. {scriptoria-0.8.0 → scriptoria-0.8.1}/src/scrip/similar.py +0 -0
  25. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/conftest.py +0 -0
  26. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_anchor_cmd.py +0 -0
  27. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_anchors.py +0 -0
  28. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_blocks.py +0 -0
  29. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_embeddings.py +0 -0
  30. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_fact_cmd.py +0 -0
  31. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_frontmatter.py +0 -0
  32. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_graph_status.py +0 -0
  33. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_hashing.py +0 -0
  34. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_index_cmd.py +0 -0
  35. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_ingest.py +0 -0
  36. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_json_shapes.py +0 -0
  37. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_lock.py +0 -0
  38. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_manifest.py +0 -0
  39. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_new_cmd.py +0 -0
  40. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_pageindex_cmd.py +0 -0
  41. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_query.py +0 -0
  42. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_retrieval.py +0 -0
  43. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_similar_cmd.py +0 -0
  44. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_span_cmd.py +0 -0
  45. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_stamp.py +0 -0
  46. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_status_cmd.py +0 -0
  47. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_unlock_cmd.py +0 -0
  48. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_verify.py +0 -0
  49. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_version.py +0 -0
  50. {scriptoria-0.8.0 → scriptoria-0.8.1}/tests/test_watch.py +0 -0
@@ -15,6 +15,10 @@ build/
15
15
  # OS
16
16
  .DS_Store
17
17
 
18
+ # Secrets: harness wiki-publish credentials (gh_username/password/wikirepo).
19
+ # Never commit. The real file lives with the private KB, not in this repo.
20
+ .env
21
+
18
22
  # Embeddings index: a large, regenerable binary cache (rebuild with `scrip index`)
19
23
  /.kb/embeddings/
20
24
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptoria
3
- Version: 0.8.0
3
+ Version: 0.8.1
4
4
  Summary: Deterministic scriptorium-keeper (the `scrip` CLI): staleness, provenance integrity, and fact queries for an agent-compiled knowledge base
5
5
  Project-URL: Homepage, https://github.com/coredipper/scriptorium
6
6
  Project-URL: Changelog, https://github.com/coredipper/scriptorium/blob/main/CHANGELOG.md
@@ -2,7 +2,7 @@
2
2
  # Distribution name on PyPI is `scriptoria` (scrip/scriptorium were taken); the
3
3
  # CLI command and the import package both remain `scrip`.
4
4
  name = "scriptoria"
5
- version = "0.8.0"
5
+ version = "0.8.1"
6
6
  description = "Deterministic scriptorium-keeper (the `scrip` CLI): staleness, provenance integrity, and fact queries for an agent-compiled knowledge base"
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.10"
@@ -13,7 +13,7 @@ from __future__ import annotations
13
13
 
14
14
  from pathlib import Path
15
15
 
16
- __version__ = "0.8.0"
16
+ __version__ = "0.8.1"
17
17
 
18
18
  # --- canonical vault layout ------------------------------------------------
19
19
  # ``root`` is the repo/instance root: the directory containing ``vault/``.
@@ -21,6 +21,7 @@ from __future__ import annotations
21
21
 
22
22
  import json
23
23
  import re
24
+ from collections.abc import Iterator
24
25
  from datetime import datetime, timezone
25
26
  from pathlib import Path
26
27
 
@@ -76,6 +77,18 @@ def _now() -> str:
76
77
  # --------------------------------------------------------------------------- #
77
78
  # Input parsing & structural validation (DataError, exit 3)
78
79
  # --------------------------------------------------------------------------- #
80
+ def _iter_lf_lines(text: str) -> Iterator[str]:
81
+ """Yield ``text.split("\n")``-equivalent lines without allocating the list."""
82
+ start = 0
83
+ while True:
84
+ end = text.find("\n", start)
85
+ if end == -1:
86
+ yield text[start:]
87
+ return
88
+ yield text[start:end]
89
+ start = end + 1
90
+
91
+
79
92
  def parse_ndjson(text: str) -> list[dict]:
80
93
  """Parse proposed records (one JSON object per line). Malformed input is a
81
94
  :class:`DataError` with its line number; an empty input is a usage error."""
@@ -84,7 +97,7 @@ def parse_ndjson(text: str) -> list[dict]:
84
97
  # delimited and may legally contain U+2028/U+2029/NEL inside a JSON string,
85
98
  # which splitlines() would wrongly treat as record breaks. trailing \r (from
86
99
  # \r\n) and the trailing empty element from a final newline are dropped below.
87
- for lineno, raw_line in enumerate(text.split("\n"), start=1):
100
+ for lineno, raw_line in enumerate(_iter_lf_lines(text), start=1):
88
101
  line = raw_line.strip()
89
102
  if not line:
90
103
  continue
@@ -4,6 +4,20 @@ from scrip.errors import DataError, UsageError
4
4
  from scrip import facts
5
5
 
6
6
 
7
+ def test_iter_lf_lines_matches_split_newline_semantics():
8
+ samples = [
9
+ "",
10
+ "one",
11
+ "one\n",
12
+ "one\n\n",
13
+ "one\r\ntwo\r\n",
14
+ "one\rtwo",
15
+ "one\u2028two\ntwo\u2029three",
16
+ ]
17
+ for text in samples:
18
+ assert list(facts._iter_lf_lines(text)) == text.split("\n")
19
+
20
+
7
21
  def test_parse_ndjson_basic():
8
22
  text = '{"a": 1}\n{"b": 2}\n'
9
23
  assert facts.parse_ndjson(text) == [{"a": 1}, {"b": 2}]
@@ -1141,7 +1141,7 @@ wheels = [
1141
1141
 
1142
1142
  [[package]]
1143
1143
  name = "scriptoria"
1144
- version = "0.8.0"
1144
+ version = "0.8.1"
1145
1145
  source = { editable = "." }
1146
1146
  dependencies = [
1147
1147
  { name = "duckdb" },
File without changes
File without changes
File without changes
File without changes