Commit Graph
68 Commits
Author SHA1 Message Date
KaifAhmad1 db4361ad46 feat(provenance): close PROV-O compliance gaps and high-stakes trust blockers (closes #825)
Part A - high-stakes trust blockers:
- Invalidation tombstones via ProvenanceManager.invalidate() (archive-then-append,
  never mutates or deletes) instead of hard delete
- Hash-chained integrity: sequence_id/previous_checksum chain every entry to its
  predecessor; new verify_chain() detects wholesale row deletion that a lone
  per-row checksum cannot
- Typed Agent (AgentRecord: agent_type/is_automated) and Activity (ActivityRecord:
  start/end timing), wired through all 18 *_provenance.py wrappers
- Split parent_entity_id into previous_version_id (correction) vs derived_from_id
  (cross-source derivation), additive alongside the legacy combined field
- Downstream/descendant lineage traversal (get_descendants/trace_descendants,
  reverse BFS) closing the dead direction="downstream" code path in the
  Explorer's provenance route
- Qualified Association+hadRole and Invalidation in export_prov()
- New CLI: provenance invalidate|verify-chain|descendants

Part B - general PROV-O spec completeness:
- Qualified Generation/Usage/Derivation in export_prov()
- wasAssociatedWith, actedOnBehalfOf, wasInformedBy relations
- Bitemporal fields (valid_from/valid_until/revision_type/supersedes) plus
  revision_history()/query_recorded_between(), closing the deprecated
  kg.ProvenanceTracker's "no direct equivalent yet" migration gaps
- prov:Bundle/hadMember membership via bundle_id
- Configurable base_uri (--base-uri CLI flag), shared by RDFExporter's
  NamespaceManager and OWLExporter's default ontology_uri so KG/OWL/PROV
  exports co-resolve under one namespace instead of three hardcoded ones

Bugs fixed along the way:
- agent_id was a dead field: no track_* method read it from kwargs
- track_entities_batch silently absorbed typed kwargs into the metadata blob
- compute_checksum() had to exclude entity_id itself: hashing it made
  track_entity's versioning-archive relabel permanently orphan any entry
  already chained from the pre-relabel checksum, a false-positive "broken
  chain" for a legitimate rename
- InMemoryStorage.get_chain_head() ignored the committed head whenever the
  current transaction had staged entries, corrupting the next chain link
- several new ProvenanceEntry fields were wired into the dataclass and
  export_prov() but not into SQLiteStorage's DDL/INSERT/row-mapping;
  InMemoryStorage masked the gap. Added a permanent round-trip regression
  test to catch this class of bug for future field additions

Flagged, not fixed (separate pre-existing issues, out of scope for #825):
- pipeline/pipeline_provenance.py imports a nonexistent module and wraps a
  Pipeline dataclass with no run() method
- most *_provenance.py wrappers' backing classes are themselves missing or
  incomplete (context_manager, deduplicator, normalizer, etc.)
- kg_provenance.py passes entity_type inside metadata={} instead of as a
  top-level track_entity() kwarg across most of its call sites
2026-08-03 22:28:48 +05:30
Sameer6305 16893c28a4 docs(provenance): document atomic rollback behavior (#782) 2026-07-30 16:28:40 +05:30
KaifAhmad1 f99241ca88 fix(provenance): stop reads from taking the writer lock, fix batch count inflation
Two review findings on #807/#812:

- retrieve() and trace_lineage() were routed through transaction()'s
  BEGIN IMMEDIATE, so plain reads took SQLite's writer lock and
  serialized behind every other read/write, defeating the WAL
  concurrency this PR was meant to add. They now use a dedicated
  _read_connection() (configured, no explicit BEGIN).

- track_entity()/track_chunk() swallowed all internal storage
  exceptions unconditionally, so a single item's failure inside
  track_entities_batch()/track_chunks_batch()'s shared transaction
  never reached the batch loop's per-item except, inflating
  tracked_count for entries that were never persisted. Both now
  re-raise when called with a shared _conn (batch context) while
  still degrading gracefully on standalone calls.

Added regression tests for both, corrected the CHANGELOG entry and
docs that described the prior (overly broad) behavior.
2026-07-29 12:54:43 +05:30
Sameer6305 9458cf5b2b docs: update provenance documentation for SQLiteStorage WAL and batch tracking (#807) 2026-07-28 23:42:14 +05:30
Sameer6305 ce914b396a docs: clarify Snowflake OAuth auth, add ArrowIngestor and non-re-exported ingestors (PR #808) 2026-07-28 15:00:02 +05:30
KaifAhmad1 b105b8ea97 fix: address review feedback on Databricks/Snowflake docs (PR #808)
- README: get_table_lineage() takes table_name first, then catalog/schema
  keyword args — the example had them in the wrong order, which would have
  queried lineage for the wrong fully-qualified table when copy-pasted.
- modules.md: the ingest example used DatabricksIngestor without importing
  it, causing a NameError if copy-pasted as-is.
- guides/ingest.md: corrected the claim that Databricks/Snowflake ingestors
  return "the same shape as DBIngestor" — DBIngestor.execute_query() returns
  a raw List[Dict] with no wrapper, unlike DatabricksData/SnowflakeData.
2026-07-28 12:10:37 +05:30
KaifAhmad1 6ed5aea993 docs: highlight Databricks/Snowflake enterprise data ingestion, fix ingest doc bugs
Makes enterprise lakehouse/warehouse ingestion (Databricks Unity Catalog +
Delta Lake, Snowflake) a first-class, prominently documented capability
across the README and guides, and adds matching runnable examples to
docs/guides/ingest.md. Also fixes several pre-existing inaccuracies caught
while auditing the ingest module docs against the actual source:
WebIngestor has no ingest_urls() (only singular ingest_url()), XMLIngestor's
XSD option is schema_path (not validate_xsd) and belongs on ingest() not the
constructor, and the "Available ingestors" list was missing DatabricksIngestor
while listing several classes not actually exported from semantica.ingest.
2026-07-28 11:58:09 +05:30
Sameer Kadam 18c8ba58ef docs: improve MCP server guide onboarding and integration guidance (#704)
* docs: improve MCP server guide onboarding and integration guidance

* docs: fix MCP server implementation mismatches
2026-07-16 21:51:55 +05:30
Mohd Kaif 7fecdae119 Merge pull request #703 from Sameer6305/docs/improve-change-management-guide
docs: improve change management guide onboarding and workflow guidance
2026-07-12 15:57:04 +05:30
KaifAhmad1 b5e0529709 docs: fix contradictory storage-behavior wording in change management guide
'By default, initializing ... with storage_path=...' read as if passing
storage_path were the default, contradicting the very next sentence
about the no-argument in-memory default. Rephrased so the in-memory
default isn't undercut by the first sentence.
2026-07-12 15:52:25 +05:30
Mohd KaifandKaifAhmad1 5b8d5c5ff6 docs: improve SHACL validation guide onboarding and workflow guidance (#702)
* docs: improve SHACL validation guide onboarding and workflow guidance

* docs: fix SHACL validation implementation mismatches

* docs: fix stale violation URIs and drop unused imports in SHACL guide

Step 5's illustrative explain_violations() output still referenced the
old cti.example.org/data/... node URIs after Step 4's data_ttl was
rewritten to use example.org/... URIs. Also removes now-unused
export_rdf/tempfile/os imports left over from replacing dynamic RDF
export with inline Turtle strings in five of the code examples.

---------

Co-authored-by: KaifAhmad1 <kaifahmad087@gmail.com>
2026-07-12 15:37:50 +05:30
KaifAhmad1 f0828b1ff6 docs: fix stale violation URIs and drop unused imports in SHACL guide
Step 5's illustrative explain_violations() output still referenced the
old cti.example.org/data/... node URIs after Step 4's data_ttl was
rewritten to use example.org/... URIs. Also removes now-unused
export_rdf/tempfile/os imports left over from replacing dynamic RDF
export with inline Turtle strings in five of the code examples.
2026-07-12 15:33:15 +05:30
Mohd KaifandKaifAhmad1 611be57ee6 docs: improve conflict resolution guide onboarding and workflow guidance (#701)
* docs: improve conflict resolution guide onboarding and workflow guidance

* docs: fix conflict resolution implementation mismatches

* docs: correct credibility-weighted example output values

Fix stale/incorrect weight and confidence figures in the conflict
resolution guide that don't match actual resolver output, and update
a leftover credibility_score field reference in Common Pitfalls.

---------

Co-authored-by: KaifAhmad1 <kaifahmad087@gmail.com>
2026-07-07 16:07:47 +05:30
KaifAhmad1 6bfb9c719c docs: correct credibility-weighted example output values
Fix stale/incorrect weight and confidence figures in the conflict
resolution guide that don't match actual resolver output, and update
a leftover credibility_score field reference in Common Pitfalls.
2026-07-07 16:03:19 +05:30
Mohd Kaif 05fe7d81d7 Merge pull request #700 from Sameer6305/docs/improve-deduplication-guide
docs: improve deduplication guide onboarding and workflow guidance
2026-07-07 15:13:13 +05:30
KaifAhmad1 f7821ec350 docs: use merge_entity_group() where the guide says to
The merging example told readers to use merge_entity_group() for
already-confirmed duplicate groups, but the code right below it still
called merge_duplicates() on group.entities, which re-runs duplicate
detection redundantly. Update the call to match the stated guidance.
2026-07-07 15:05:13 +05:30
Mohd Kaif 9680dece2e Merge pull request #699 from Sameer6305/docs/improve-policy-engine-guide
docs: improve Policy Engine guide onboarding and implementation accuracy
2026-07-05 13:29:16 +05:30
KaifAhmad1 aa2cd00f07 docs: fix inverted pitfall wording and broken required_* pattern in mortgage example
- Correct the unsupported-rule-key pitfall: absent keys fail compliance,
  present keys (any value) pass — the previous wording had this backwards.
- Remove required_ltv/pd/lgd/dsti/credit_score: True from the mortgage
  example. required_* checks equality against the given value, so True
  against a real numeric field silently marks compliant decisions as
  non-compliant (verified: a fully passing decision still returned False).
  The min_/max_ rules already enforce presence of ltv/dsti/credit_score.
2026-07-05 13:24:22 +05:30
Mohd Kaif 9094f1ed95 Merge pull request #698 from Sameer6305/docs/improve-multi-agent-guide
docs: improve multi-agent guide onboarding and coordination guidance
2026-07-04 13:25:33 +05:30
Mohd KaifandKaifAhmad1 4011f80eff docs: improve export guide onboarding and workflow guidance (#697)
* docs: improve export guide onboarding and workflow guidance

* docs: fix export guide implementation mismatches

* docs: revert .content to .text in export guide examples

FileObject.content is raw bytes; AgentContext.store() only accepts str/list and raises ValueError on bytes, so the previous fix commit broke both domain examples.

---------

Co-authored-by: KaifAhmad1 <kaifahmad087@gmail.com>
2026-07-04 13:10:00 +05:30
KaifAhmad1 7e70508ac9 docs: revert .content to .text in export guide examples
FileObject.content is raw bytes; AgentContext.store() only accepts str/list and raises ValueError on bytes, so the previous fix commit broke both domain examples.
2026-07-04 13:04:28 +05:30
Sameer Kadam d336898f77 docs: improve provenance guide onboarding and practical guidance (#696)
* docs: improve provenance guide onboarding and practical guidance

* docs: fix provenance implementation mismatches
2026-07-04 12:31:08 +05:30
Mohd Kaif 53e1769956 Merge pull request #695 from Sameer6305/docs/improve-semantic-extraction-guide
docs: improve semantic extraction guide onboarding and workflow guidance
2026-07-04 12:11:02 +05:30
Mohd Kaif 6e7c388242 docs: improve LLM integrations guide onboarding and provider guidance (#694)
* docs: improve llm integrations guide onboarding and provider guidance

* docs: fix LLM integration implementation mismatches
2026-07-04 12:05:27 +05:30
Mohd Kaif 92fb7b0826 Merge pull request #693 from Sameer6305/docs/improve-decision-intelligence-guide
docs: improve decision intelligence guide onboarding and practical guidance
2026-07-03 12:51:51 +05:30
KaifAhmad1 69d61384fd docs: clarify VectorStore omission error type in decision tracking info box
Distinguishes the TypeError from leaving the argument out entirely vs.
the ValueError raised when vector_store=None is passed explicitly.
2026-07-03 12:39:44 +05:30
Sameer Kadam 12067840a5 docs: improve distance intelligence guide onboarding and concepts (#692) 2026-07-03 12:05:44 +05:30
Sameer KadamandKaifAhmad1 7a4810893a docs: improve agent memory guide onboarding and usage guidance (#691)
* docs: improve agent memory guide onboarding and usage guidance

* docs: align Agent Memory guide with persistence implementation

* docs: fix misleading index_path persistence claim across guides

VectorStore's index_path kwarg is silently absorbed into FAISSStore's
**config and never read anywhere in faiss_store.py, so it does not make
the FAISS index persist across restarts as several docs implied. Real
persistence requires an explicit VectorStore.save()/.load() call, or
AgentContext.save()/.load() which cascades to it.

- docs/reference/context.md: rewrite the "Persist your vector store"
  tip to explain the actual save()/load() mechanism instead of the
  dead index_path kwarg.
- docs/guides/graphrag.md, decision-intelligence.md, ingest.md,
  semantic-extraction.md: drop the dead index_path=... kwarg from
  VectorStore(backend="faiss", ...) constructor calls.

Follow-up to #691, which fixed the same false claim in
docs/guides/agent-memory.md but missed these other files.

---------

Co-authored-by: KaifAhmad1 <kaifahmad087@gmail.com>
2026-07-02 17:40:42 +05:30
Sameer Kadam 5430167dbc docs: improve GraphRAG guide onboarding and practical guidance (#690)
* docs: improve GraphRAG guide onboarding and practical guidance

* docs: align GraphRAG guide with retrieval implementation
2026-07-02 16:24:55 +05:30
Mohd Kaif 46540df5f0 Merge pull request #689 from Sameer6305/docs/improve-visualization-guide
docs: improve visualization guide onboarding and workflow guidance
2026-07-02 13:29:12 +05:30
KaifAhmad1 9ac3066fe1 docs: fix node-count inconsistency in performance warning 2026-07-02 13:24:16 +05:30
Sameer6305 8cf19a6b2e docs: fix change management implementation mismatches 2026-06-29 20:00:50 +05:30
Sameer6305 6f4db5a693 docs: fix SHACL validation implementation mismatches 2026-06-29 19:37:24 +05:30
Sameer6305 8d60f68fcd docs: fix conflict resolution implementation mismatches 2026-06-29 17:00:01 +05:30
Sameer6305 6742b08743 docs: fix deduplication implementation mismatches 2026-06-29 16:27:18 +05:30
Sameer6305 ccb9e070b4 docs: fix policy engine implementation mismatches 2026-06-29 16:17:56 +05:30
Sameer6305 d243143316 docs: fix multi-agent implementation mismatches 2026-06-29 16:04:02 +05:30
Sameer6305 0ecf43f5f6 docs: fix export guide implementation mismatches 2026-06-29 15:40:50 +05:30
Sameer6305 4d784d0aea docs: fix LLM integration implementation mismatches 2026-06-29 15:05:25 +05:30
Sameer6305 dcff5e3b3d docs: align decision intelligence guide with implementation 2026-06-29 14:42:30 +05:30
Sameer6305 0ad1f64cc9 docs: fix visualization guide implementation alignment 2026-06-29 13:05:01 +05:30
Mohd Kaif c93af4a514 Merge pull request #688 from Sameer6305/docs/improve-graph-analytics-guide
docs: improve graph analytics guide onboarding and practical guidance
2026-06-27 21:19:37 +05:30
KaifAhmad1 9c379e1a0e fix(docs): align node threshold and consolidate data quality guidance
- Remove duplicate Data Quality Info block; content moved into Common Pitfalls as a dedicated pitfall entry, keeping the critical advanced_analytics=True warning as the sole callout
- Align node count threshold: Common Pitfalls now consistently references 100+ nodes (was '< 50 nodes'), matching the When To Use recommendation
2026-06-27 21:13:34 +05:30
Mohd Kaif 231cbc613b Merge pull request #687 from Sameer6305/docs/improve-reasoning-guide
docs: improve reasoning guide onboarding and practical guidance
2026-06-27 21:03:04 +05:30
KaifAhmad1 355b811e59 fix(docs): correct factual errors and tab placement in reasoning guide
- Fix CVE in SUNBURST example: CVE-2024-3400 → CVE-2020-10148, matching context-graphs.md
- Correct load_from_graph fact format: predicates/args are lowercased (threatactor(apt29), not ThreatActor(APT29)); scoped to DatalogReasoner only; removed incorrect metadata-to-predicate claim
- Move Common Pitfalls section after </Tabs> so it renders outside the tab component and is visible to all readers
2026-06-27 20:54:06 +05:30
Mohd Kaif 5c27e539ec Merge pull request #686 from Sameer6305/docs/improve-context-graphs-guide
docs: improve context graph guide onboarding and practical guidance
2026-06-26 21:39:21 +05:30
KaifAhmad1 d74477bf94 fix(docs): correct API inaccuracies in context graph guide
- Replace non-existent shortest_path() with get_neighbors() + path_to_anchor
- Remove non-existent extract_subgraph() calls from all domain tab examples
- Clarify automated extraction requires knowledge_graph= constructor arg and list input
- Distinguish save_to_file() (graph only) from AgentContext.save() (graph + FAISS + memory)
- Add resolve_links() step to serialization section for cross-graph link restoration
- Link duplicate entities pitfall to the deduplication guide and its API
2026-06-26 21:32:55 +05:30
Mohd Kaif 4f6db9601c Merge pull request #685 from Sameer6305/docs/improve-ontology-guide
docs: improve ontology guide onboarding and practical guidance
2026-06-26 12:09:55 +05:30
KaifAhmad1 5f6cac0a77 fix(docs): correct code errors in ontology guide simple example
- Replace ctx.store() + graph.to_dict() with direct entity/relationship
  dict to avoid key mismatch (to_dict() returns nodes/edges; generator
  reads entities/relationships)
- Fix prop type filter: 'datatype' → 'data' (value set by PropertyGenerator)
- Fix domain/range printing: both are stored as lists, not scalars
- Clarify Reasoning bullet: OWL inference requires an external reasoner,
  Semantica only exports the ontology
- Remove duplicate LLM-vs-graph-generator pitfall already covered by the
  Info callout in the LLMOntologyGenerator section
2026-06-26 11:53:56 +05:30
Sameer KadamandKaifAhmad1 e87f0832a3 docs: improve pipeline guide onboarding and workflow guidance (#683)
* docs: improve pipeline guide onboarding and workflows

* fix(docs): correct broken pipeline guide examples from review

- Remove Option 1 (register_step_handler + string name): ExecutionEngine
  never resolves string handler names via step_registry, so it raised
  TypeError at runtime; replace with the single working pattern
- Add missing step_type positional arg to all new add_step() calls
- Use connect_steps() for checkpoint dependency instead of the
  dependencies= kwarg, consistent with every other example in the file
- Move extract_entities definition above its call site to fix NameError
- Replace docstring on save_checkpoint with inline comment to match
  the no-docstring convention used by all other handlers in the file

---------

Co-authored-by: KaifAhmad1 <kaifahmad087@gmail.com>
2026-06-25 12:53:08 +05:30