Commit Graph
100 Commits
Author SHA1 Message Date
KaifAhmad1 3806883093 docs: add CHANGELOG entry for kg.ProvenanceTracker deprecation (#744)
Documents the 9 pre-existing test failures caused by never-implemented
kg.ProvenanceTracker compatibility methods, the deprecation fix, and
the follow-up migration guide addition in this PR.
2026-07-17 15:46:01 +05:30
KaifAhmad1 581dbf8301 docs: add missing kg.ProvenanceTracker migration guide
Every deprecation warning added in this PR (and the class docstring)
points to docs/migration/kg-provenance-tracker.md, but the file was
never added, so the reference was dead. Adds the guide with a
method-mapping table to semantica.provenance.ProvenanceManager.
2026-07-17 15:40:30 +05:30
KaifAhmad1 d71d4191aa docs(readme): fix Qodo review findings on backend install docs and terminology
Add graph-apache-age extra (psycopg2-binary) which was previously
undeclared despite age_store.py depending on it, wire it into
graph-all, and document install commands for FalkorDB/AGE/Neptune
alongside Neo4j. Note that RDF triple stores need no extra since they
talk SPARQL over HTTP via the core `requests` dependency. Also align
README's "Triplet Stores" table label to "Triple Stores (RDF)" to
match the standard term used elsewhere in the docs, while keeping the
TripletStore interface name in backticks.
2026-07-16 12:57:30 +05:30
KaifAhmad1 5b357c47cc docs(readme): highlight dual RDF + LPG graph storage support
Semantica already ships both an RDF triplet-store stack (Blazegraph,
Apache Jena, Eclipse RDF4J via a unified TripletStore/SPARQL interface)
and an LPG graph-store stack (Neo4j, FalkorDB, Apache AGE, AWS Neptune
via Cypher), but the README only surfaced the LPG side. Add a hero
highlight line, a "What Semantica gives you" bullet, and split the
Features-at-a-Glance table row so both formats and all backends are
named explicitly.
2026-07-16 12:49:29 +05:30
KaifAhmad1 c90b7fb02b Merge remote-tracking branch 'origin/main' into fix/742-retrack-parent-override
# Conflicts:
#	CHANGELOG.md
2026-07-15 15:44:47 +05:30
KaifAhmad1 869083e0f6 Avoid duplicating archived history id in used_entities when no explicit parent was supplied; add CHANGELOG entry for #742
Review follow-up: only append archived_history_id to used_entities when
explicit_parent_supplied is True. Previously it was appended unconditionally,
so the no-explicit-parent re-track path ended up with the same history id in
both parent_entity_id and used_entities, duplicating the reference in
get_lineage() output.
2026-07-15 15:36:48 +05:30
KaifAhmad1 62b079a9c3 Merge main, resolve CHANGELOG.md conflict with #732 2026-07-15 13:18:21 +05:30
KaifAhmad1 de0357aec8 Fix code review findings: metadata precedence and Mapping support
- get_lineage() aggregated metadata by iterating trace_lineage()'s BFS
  order and calling dict.update() on each entry, so ancestor metadata
  (now reachable via derived_from chains) could overwrite the queried
  entity's own metadata on conflicting keys. Reverse the iteration so
  the queried entity (always lineage_entries[0]) is applied last and
  wins, matching the documented "most recent entry's metadata takes
  precedence" intent.
- track_entity()'s derived_from guard only accepted a concrete dict,
  silently ignoring other collections.abc.Mapping implementations
  (e.g. types.MappingProxyType). Switch the isinstance check to
  Mapping so any mapping-like metadata is honored.

Addresses Qodo review findings on PR #741.
2026-07-15 12:27:42 +05:30
KaifAhmad1 7d83b6744f Fix ProvenanceManager.get_lineage not linking entities via derived_from
track_entity() only auto-linked a parent by looking up `source` as an
existing entity_id, so two entities sharing a real source URL (e.g. a
document and a decision derived from it) never got connected, and
metadata["derived_from"] was stored but never consulted by any linking
or traversal code.

track_entity() now treats metadata["derived_from"] as an explicit
parent link (unless parent_entity_id was already passed directly), so
the existing BFS in trace_lineage() picks it up for free.

Closes #735
2026-07-15 12:14:53 +05:30
KaifAhmad1 d90929730d Re-sort rules on duplicate-add path (#732 review follow-up)
Rule is a mutable dataclass, so an already-registered rule's priority
could change after being added; the dedup early-return skipped the
priority re-sort, so re-adding a rule after mutating its priority
left self.rules stale relative to that change. The duplicate branch
now re-sorts before returning, matching the append path.
2026-07-15 11:54:07 +05:30
KaifAhmad1 7455ed254c Address review: warn on duplicate rule, guard non-string conditions
- add_rule()'s duplicate-skip path now logs at warning level instead
  of debug, so a skipped duplicate is visible by default rather than
  silent in typical logging configs
- The duplicate-rule log message now stringifies conditions via
  map(str, ...) before joining, since Rule.conditions is List[Any]
  and non-string entries would otherwise raise TypeError
2026-07-15 11:52:10 +05:30
KaifAhmad1 1d502d5e74 Fix Reasoner.add_rule missing deduplication (#732)
add_rule() unconditionally appended to self.rules, so re-running the
same setup code on an existing Reasoner instance (e.g. re-executing a
Jupyter cell) duplicated every rule; forward_chain() would then match
the duplicated rules but silently return no new results since the
conclusions were already in self.facts, with no error or warning.

add_rule() now compares an incoming rule's rule_type, conditions, and
conclusion against existing rules and returns the existing Rule
instead of appending a duplicate, keeping repeated add_rule() calls
with the same definition idempotent.
2026-07-15 11:42:38 +05:30
KaifAhmad1 49e5430aa3 docs: add changelog entry for InferenceResult.premises fix (#739) 2026-07-14 22:47:50 +05:30
KaifAhmad1 8157fa5fd5 Merge remote-tracking branch 'origin/main' into fix/733-explanation-premises 2026-07-14 22:47:21 +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
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
KaifAhmad1 0e2dc7462c docs: fix nonexistent semantica benchmark CLI reference
semantica.cli has no benchmark subcommand. Point to the actual
runnable benchmark suite under tests/vector_store instead.
2026-07-09 11:35:46 +05:30
KaifAhmad1 20b1455480 docs: reposition README as category-defining accountability layer
Consolidate the hero around a single category claim (Context and
Accountability Layer for AI agents), drop the named-competitor
comparison table (LangChain/LlamaIndex/Mem0/Zep/Palantir Foundry),
remove GitHub alert-box tips/notes, cut redundant module/changelog
sections, strip vanity feature counts, and trim em dashes for a
cleaner, more premium read.
2026-07-09 11:29:08 +05:30
KaifAhmad1andLuffy2208 ada5aa7615 docs: add changelog entry for sqlite-vec vector store backend
Co-Authored-By: Luffy2208 <209925020+Luffy2208@users.noreply.github.com>
2026-07-08 18:53:37 +05:30
KaifAhmad1andLuffy2208 94c83697b0 fix: address sqlite-vec review findings (tests, WAL/sync, batching)
- Add SQLITE_VEC_AVAILABLE flag via importlib.util.find_spec so the test
  suite's skipif actually reflects whether sqlite-vec is installed; it was
  previously undefined, causing all sqlite vector store tests to be
  silently skipped regardless of installation state.
- Actually apply PRAGMA synchronous=NORMAL alongside journal_mode=WAL when
  use_wal=True, matching the documented behavior; document use_wal as an
  opt-in kwarg in the docstring and usage guide.
- Correct _is_safe_identifier error messages (regex never allowed hyphens).
- Batch get() and update() with IN(...)/executemany instead of per-id
  round trips, consistent with add()/delete().
- Fix flaky test_update_vectors assertion that relied on list.index()
  over dicts containing numpy arrays.
- Reorder sqlite_vec_store import alphabetically in vector_store/__init__.py.

Co-Authored-By: Luffy2208 <209925020+Luffy2208@users.noreply.github.com>
2026-07-08 18:49:34 +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
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
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
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
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
KaifAhmad1 9ac3066fe1 docs: fix node-count inconsistency in performance warning 2026-07-02 13:24:16 +05:30
KaifAhmad1 064daca6f9 docs(readme): bump to 0.5.1, add What's New section with deployment platform badges 2026-06-29 15:37:28 +05:30
KaifAhmad1 0de843067b chore(release): bump version to 0.5.1 2026-06-29 15:20:26 +05:30
KaifAhmad1 f2c60256f1 docs(changelog): add [Unreleased] entries for Arrow ingestion (#705) 2026-06-28 12:49:52 +05:30
KaifAhmad1 006f37c062 fix(arrow): eliminate double full-scan and clean up reader wrapper
- Replace _read_batches with _read_batches_with_info which collects
  batch metadata (total_rows, record_batches) during the same pass as
  the data read, so ingest_file no longer calls _file_metadata before
  _read_batches. For a limit=1 read on a large file this previously
  scanned every batch twice; now it stops after the first batch.

- _file_metadata is now only invoked for include_data=False (where a
  full scan is unavoidable to report accurate row counts).

- Remove the dead num_record_batches property from _ArrowReaderWrapper;
  it was never called by production code and its is_table branch
  materialised all batches just to count them.

- Fix _open_file exception chain: raise ... from file_err instead of
  from feather_err so the most diagnostic IPC error appears in the
  Python traceback chain, not the least informative fallback error.
2026-06-28 12:40:28 +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
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
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
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
KaifAhmad1 dd7d1b8bc5 fix(docs): address review findings in ingest guide
- Expand intro to cover Git (dict/code_files) and stream (StreamMessage/.content) return shapes, which the previous two-class split omitted
- Add missing imports and AgentContext setup to the Source 1 internal-docs snippet (NameError on copy-paste)
- Add advanced_analytics=True to ContextGraph in both Business Examples (required for extract_entities=True to populate graph analytics)
- Replace bare `pass` credential with YOUR_DB_PASSWORD placeholder to match the YOUR_*_KEY convention used elsewhere
- Guard nullable description/resolution columns in ticket_texts with `(r[...] or '')` to prevent TypeError on NULL rows
- Replace misleading time.sleep() rate-limit advice with accurate description of RESTIngestor's built-in 429 retry/backoff and how to tune it
2026-06-25 11:59:06 +05:30
KaifAhmad1 445c487fcc fix(helm): add namespace: .Release.Namespace to all Helm templates
Without an explicit namespace in metadata, checkov (CKV_K8S_21) flags
every resource as using the default namespace. Using .Release.Namespace
lets helm install --namespace semantica --create-namespace correctly
scope all resources to the target namespace.
2026-06-24 23:09:10 +05:30
KaifAhmad1 2440c5adb4 fix(ci): make .checkov.yaml a valid YAML mapping to prevent NoneType parse error
An empty/comment-only YAML file is parsed as NoneType by PyYAML.
Checkov requires a dict; adding skip-check: [] satisfies the parser
without globally suppressing any checks.
2026-06-24 23:01:28 +05:30
KaifAhmad1 b9e069301f fix(deploy): address security and correctness blockers from PR review
- gcp/cloudrun-service.yaml: add comment + README sed one-liner so PROJECT_ID
  is substituted before gcloud run services replace (was a literal placeholder
  that caused image-pull failure on the declarative deploy path)
- azure/main.parameters.json: replace wildcard allowedOrigins "*" with a
  REPLACE_ME placeholder; add README note to set the real URL after first deploy
- kubernetes/networkpolicy.yaml + helm networkpolicy template: add from: selector
  (ingress-nginx namespace + same-namespace pods) so ingress is no longer
  allow-all; restrict egress to FalkorDB port 6379 and DNS port 53 instead of
  the allow-all egress: - {} wildcard
- helm/values.yaml: expose networkPolicy.ingressNamespace and falkordbPort values
- kubernetes/deployment.yaml: add secretRef for knowledge-explorer-secrets so
  FALKORDB_PASSWORD is actually injected into the container
- app.py: add _mutation_bridge_installed guard to prevent closure stacking when
  the same GraphSession is passed to create_app() more than once; remove
  duplicate app.state.allowed_origins assignment (single source of truth is
  app.state.explorer_settings); add comment on falkordb_host/port dead config
- tests: update allowed_origins assertions to use explorer_settings dict
- .checkov.yaml: remove global CKV_K8S_21/28/30 suppressions; rely on per-file
  inline checkov:skip comments in cloudrun-service.yaml so future real K8s
  manifests are not silently exempted
2026-06-24 22:55:18 +05:30
KaifAhmad1 bacc37ab77 fix(ci): suppress CKV_K8S_21 false-positive on Cloud Run Knative YAML
checkov scans deploy/gcp/cloudrun-service.yaml as a Kubernetes resource
because it has apiVersion: serving.knative.dev/v1. It flags CKV_K8S_21
('default namespace should not be used') because Cloud Run services have
no metadata.namespace field — they are project/region scoped, not
namespace scoped. Add CKV_K8S_21 to .checkov.yaml skip-check and to the
inline skip comment in cloudrun-service.yaml.
2026-06-24 14:13:00 +05:30
KaifAhmad1 52e8f38361 fix(ci): move checkov out of MSDO into standalone bridgecrewio/checkov-action
Root cause of 6 consecutive CI failures:
MSDO 0.215.0's guardian.cmd wrapper breaks the build whenever checkov exits
with code 1. Checkov exits 1 on ANY violation, including MEDIUM/LOW findings
that are all 'below minimum severity'. This makes Active results = 0 and
'Found no breaking results', yet Guardian still raises BreakException because
it treats the tool's exit code as a first-class breaking signal. The
.checkov.yaml soft-fail setting was never read because the MSDO runner
bypasses repository config files.

Fix:
- Remove checkov from the MSDO tools list (stops the guardian.cmd crash)
- Add a dedicated 'checkov' job on ubuntu-latest using the official
  bridgecrewio/checkov-action@v12, which runs a current checkov release,
  runs on Linux, and correctly reads .checkov.yaml and respects soft_fail
- Set soft_fail: true in the action so low/medium findings appear in the
  Security tab without ever blocking the build
- MSDO continues to run eslint, templateanalyzer (Bicep/ARM), and terrascan;
  these tools all have well-behaved exit codes and produce no active results
  after the security fixes applied earlier in this PR

.checkov.yaml:
- Replace soft-fail: true (was a failed workaround for MSDO) with
  skip-check: [CKV_K8S_28, CKV_K8S_30] — correct suppression for the
  Knative false-positives (Cloud Run enforces seccomp + AppArmor at
  platform level without requiring K8s annotations)
2026-06-24 14:05:26 +05:30
KaifAhmad1 3f57bab9d3 fix(ci): suppress false-positive checkov K8s checks on Knative YAML; drop redundant seccomp annotation
checkov scans deploy/gcp/cloudrun-service.yaml as a Kubernetes resource
(it has apiVersion: serving.knative.dev/v1) and raises CKV_K8S_28 /
CKV_K8S_30. Adding those annotations to spec.template.metadata.annotations
caused checkov to crash (exit 1 with no SARIF output) — likely a bug in
checkov's AppArmor check when it tries to match the annotation container
name against containers in a Knative RevisionSpec. Fix:
  - Remove the AppArmor / seccomp annotations from the template metadata
  - Add checkov:skip comments at the file top so the false-positive checks
    are suppressed cleanly (Cloud Run enforces these at platform level)

Also drop the legacy seccomp.security.alpha.kubernetes.io/pod annotation
from deploy/helm/knowledge-explorer/values.yaml: run #186 confirmed that
the modern podSecurityContext.seccompProfile.type: RuntimeDefault field
already satisfies CKV_K8S_28 for the Helm chart without the annotation.
Adding the annotation alongside the modern field was causing the same
crash in checkov's Helm-rendered output.
2026-06-24 13:55:41 +05:30
KaifAhmad1 ef74ecf3a8 fix(ci): remove Knative pod-level securityContext and fix Bicep null ternary
checkov crashes (exit 1) on two constructs introduced in earlier commits:

1. deploy/gcp/cloudrun-service.yaml: pod-level spec.template.spec.securityContext
   is not part of Knative RevisionSpec. checkov's Knative parser panics on
   this unknown field. Remove it — CKV_K8S_28 (seccomp) and CKV_K8S_30
   (AppArmor) are already satisfied by the legacy annotations in
   spec.template.metadata.annotations; the container-level securityContext
   that IS valid in Cloud Run Gen 2 is kept.

2. deploy/azure/main.bicep: 'vnetInternal ? { ... } : null' compiles to
   ARM null() which crashes checkov's Bicep/ARM parser. Replace the inline
   null ternary with two concrete variable objects (vnetConfigInternal and
   vnetConfigExternal) so both branches are well-typed objects.
2026-06-24 13:41:28 +05:30
KaifAhmad1 2f73c1c91d fix(ci): add .checkov.yaml soft-fail to silence tool-error break in MSDO
Active results are 0 and 'Found no breaking results' but MSDO still fails
because checkov exits with code 1 whenever it finds any violation
(including MEDIUM/LOW below the minimum severity threshold). MSDO v1.12.0
treats a non-zero tool exit code as a breaking result even when Guardian
reports no active findings.

soft-fail: true makes checkov exit 0 in all cases. MSDO Guardian still
reads the full SARIF output and would surface any HIGH/CRITICAL findings
as active results that break the build, so the security posture is
unchanged.
2026-06-24 13:31:19 +05:30
KaifAhmad1 a8043418a1 fix(ci): fix 2 TemplateAnalyzer ERROR findings in Azure Bicep (AZR-000361/363)
AZR-000363 (Azure.ContainerApp.PublicAccess) — line 29 managedEnvironment:
- Add vnetConfiguration.internal: true (default) so the environment uses
  an internal load balancer instead of a public IP
- Parameterize with vnetInternal (bool, default true) and
  infrastructureSubnetId so operators can provide their subnet on deploy

AZR-000361 (Azure.ContainerApp.ManagedIdentity) — line 40 containerApp:
- Add identity.type = SystemAssigned so the Container App can
  authenticate to Azure services without storing credentials

Also update main.parameters.json and README with the new parameters.
2026-06-24 13:24:23 +05:30
KaifAhmad1 8b5f75160a fix(ci): fix 2 remaining checkov HIGH findings and Terrascan seccomp warnings
The 2 active checkov HIGH results (CKV_K8S_28 + CKV_K8S_30) were coming
from deploy/gcp/cloudrun-service.yaml — checkov scans it as a Kubernetes
resource (apiVersion: serving.knative.dev/v1) and flagged missing AppArmor
and seccomp on that file, regardless of the fixes made to the k8s/ and
helm/ manifests.

deploy/gcp/cloudrun-service.yaml:
- Add container name (explorer) so AppArmor annotation key matches
- Add AppArmor annotation to pod template metadata (CKV_K8S_30)
- Add legacy seccomp annotation (AC_K8S_0080 / CKV_K8S_28)
- Add pod-level seccompProfile: RuntimeDefault (CKV_K8S_28)
- Add container securityContext (runAsNonRoot, allowPrivilegeEscalation)
  Cloud Run Gen 2 supports all of these fields

deploy/kubernetes/deployment.yaml:
- Pin image tag from ':latest' to ':0.5.0' (AC_K8S_0068 / AC_K8S_0069)
- Add legacy seccomp pod annotation alongside existing seccompProfile field

deploy/helm/knowledge-explorer/values.yaml:
- Add legacy seccomp annotation to podAnnotations so it renders into
  the Helm-generated pod template alongside the modern seccompProfile
2026-06-24 13:15:41 +05:30
KaifAhmad1 095e8c8714 fix(ci): resolve MSDO/checkov and Terrascan failures on K8s and Helm manifests
checkov HIGH (2 breaking results, CKV_K8S_30):
- Add AppArmor annotation to k8s deployment pod template
  (container.apparmor.security.beta.kubernetes.io/explorer: runtime/default)
- Add AppArmor annotation via Helm values.yaml podAnnotations so it
  renders into the Helm-generated pod template

Terrascan warnings (AC_K8S_0087 / AC_K8S_0080 / AC_K8S_0073):
- Add runAsNonRoot: true and seccompProfile: RuntimeDefault at container
  securityContext level in both k8s deployment and Helm values (these
  were only at pod spec level before)

Terrascan AC_K8S_0002 (noHttps):
- Add nginx ssl-redirect annotation to k8s ingress so HTTPS enforcement
  is explicit at the ingress controller layer

Terrascan AC_K8S_0013 (noOwnerLabel):
- Add owner label to k8s namespace.yaml

Terrascan AC_K8S_0068 (imageWithLatestTag):
- Change Helm values.yaml image.tag from 'latest' to '' (falls back to
  .Chart.AppVersion at render time)
- Pin values.prod.yaml to explicit release tag 0.5.0
2026-06-24 13:01:54 +05:30
KaifAhmad1 b2c949f7de fix(deploy): harden security in deployment templates and explorer app
- GCP: remove --allow-unauthenticated, restrict ingress to
  internal-and-cloud-load-balancing, replace wildcard ALLOWED_ORIGINS=*
  with a substitution variable (_ALLOWED_ORIGINS) so operators supply a
  real URL at deploy time; same fix in cloudrun-service.yaml
- Fly.io: replace hardcoded FALKORDB_HOST=localhost with the correct
  .internal private-network hostname pattern; update README accordingly
- docker-compose.dev.yml: add missing top-level networks: block so the
  frontend service can join the semantica network without --file layering
- K8s/Helm: add readOnlyRootFilesystem: true + runAsUser: 1000 to
  container securityContext; mount an emptyDir /tmp so uvicorn can write
  temp files
- app.py: fix _read_explorer_settings() or-chain, use in os.environ
  checks so an explicit ALLOWED_ORIGINS="" produces an empty allow-list
  instead of silently falling through to localhost defaults; remove dead
  app.state.falkordb_host/port attributes
- docs: update four locations that still documented {"status":"healthy"}
  to reflect the new {"status":"ok"} health response
- tests: update test assertion to read falkordb settings from
  app.state.explorer_settings instead of removed top-level attributes
2026-06-24 12:51:09 +05:30
KaifAhmad1 5e7c929ca8 docs: lighten code block hover — subtle lift + faint ring 2026-06-22 16:43:27 +05:30
KaifAhmad1 350b0a953f docs: upgrade custom.css to premium design system
Replace uniform cursor-bar hover effects with a differentiated,
light animation layer per element type. Adds global polish:
smooth scroll, custom scrollbar, brand-colored text selection,
page fade-in entrance, emerald focus rings, H1 gradient underline
accent, styled blockquotes, gradient HR dividers, uppercase table
headers, and CTA button glow — all tuned to the #080C10 dark
background and #10B981 emerald brand color.
2026-06-22 16:27:16 +05:30
KaifAhmad1 e1b7b072b8 docs: replace Changelog tab with GitHub Releases external link; update inline links 2026-06-20 17:01:00 +05:30
KaifAhmad1 a9a72977a9 docs: fix trailing comma in docs.json after tab removal 2026-06-20 16:53:44 +05:30
KaifAhmad1 c5c27b35aa docs: remove Changelog tab from nav — diagnose export failure (step 2) 2026-06-20 16:49:57 +05:30
KaifAhmad1 eddb7dd914 docs: strip changelog to minimal stub — diagnose export failure 2026-06-20 16:45:28 +05:30
KaifAhmad1 4547e43dda docs: show first 60 lines of mintlify output to identify failing page 2026-06-20 16:40:35 +05:30
KaifAhmad1 5ee1548c90 docs: resolve merge conflict — keep plain-text header in changelog 2026-06-20 16:30:50 +05:30
KaifAhmad1 59aa3f1d86 docs: add mintlify export + JSX balance checks to docs_check.py; run on PRs 2026-06-20 16:28:02 +05:30
KaifAhmad1 ce8344aa73 docs: rewrite changelog as flat markdown — remove heavy accordion nesting 2026-06-20 16:11:48 +05:30
KaifAhmad1 5515390269 docs: add unreleased note and tighten changelog defaultOpen syntax 2026-06-20 15:53:59 +05:30
KaifAhmad1 850f47625f docs: address review feedback across 7 modules
- llms.md: use showcase models (llama-3.3-70b-versatile, gpt-4o) in
  provider examples and use-case tables; clarify defaults vs recommended
  in Defaults and Reproducibility section
- split.md: document that chunk_size is in characters with migration note
- ingest.md: add Note that glob patterns are not supported by ingest()
- explorer-setup.md: remove hardcoded "1.5 seconds" timing claim
- cli-setup.md: expand semantica-worker description with concrete usage
- mcp_server.md: clarify turtle/ttl are aliases for the same RDF format
- semantic_extract.md: remove emoji from code comments
2026-06-16 21:49:20 +05:30
KaifAhmad1andZohaib Hassnain 496b80cf2b tests: fix CodeQL lint in progress tracker regression tests
Consolidate dual import (module alias + from-import) to a single
`import ... as progress_module` alias and qualify all references.
Replace bare `BaseException` catch with `Exception` in the thread
runner helper.

Co-Authored-By: Zohaib Hassnain <zohaib179949@gmail.com>
Co-Authored-By: KaifAhmad1 <kaifahmad087@gmail.com>
2026-06-16 11:03:45 +05:30
KaifAhmad1andClaude Sonnet 4.6 98cec956fe chore: remove benchmarks/ — extracted to semantica-benchmarks repo
Benchmarks moved to https://github.com/KaifAhmad1/semantica-benchmarks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 18:16:45 +05:30
KaifAhmad1 a2047d696d docs(changelog): add PR #602 public API ingestion entries to Unreleased
Documents all added features, hardening fixes, and follow-up patches
from PR #602 (PublicAPIIngestor) including contributors Luffy2208 and
Sameer6305.
2026-06-10 15:47:11 +05:30
KaifAhmad1 fbdeb6873a fix(ingest): prevent mutable options mutation in batch/multi-example calls
Deep-copy **options in ingest_examples and batch_public_apis so that
mutable values (e.g. params dicts) are not shared across iterations.
Add rate_limit_delay to the config_only_key strip list in ingest_public_api
so it is not forwarded twice when passed via kwargs.
2026-06-10 15:38:30 +05:30
KaifAhmad1 1cf91f1621 fix(benchmarks): replace hardcoded module choices with dynamic discovery
- Extract _discover_modules() to scan benchmarks/ at runtime so the
  --module choices list stays accurate as directories are added or
  removed; eliminates the stale context_graph_effectiveness entry and
  the missing infrastructure entry from the original implementation
- Add an existence guard before passing the resolved path to pytest so
  a valid-looking choice that maps to a missing directory fails fast
  with a clear error instead of silently collecting 0 tests and exiting 0
- Print the active module filter to the console so users can confirm
  the filtered scope in runner output
2026-06-06 19:05:37 +05:30
KaifAhmad1 6cd0022baf docs(readme): document new CLI commands and v0.5.0 terminal experience
CLI section:
- Intro updated to mention startup dashboard and Rich polish
- Data In: added semantica watch examples; removed --watch flag from ingest
  (watch is now its own command)
- Developer Tools: new subsection covering init, doctor, changelog, shell,
  info with representative examples

What's New in v0.5.0:
- Added Modern CLI Experience subsection listing all 11 improvements:
  startup dashboard, grouped help, doctor, init, watch, changelog, shell,
  progress bars, elapsed timing, error cards, Windows UTF-8 fix
2026-06-04 21:24:02 +05:30
KaifAhmad1 9e66035b22 fix(pyproject): move [project.urls] after dependencies to fix TOML parse error
In TOML, declaring [project.urls] inside the [project] block causes all
subsequent key-value pairs (including dependencies = [...]) to be parsed
as project.urls.* keys, producing:
  ValueError: invalid pyproject.toml config: project.urls.dependencies
              must be string

Fix: move [project.urls] to after the dependencies array closes and before
[project.optional-dependencies], which is the correct TOML position for a
sub-table of [project].
2026-06-04 17:57:11 +05:30
KaifAhmad1 cbcdb61298 feat(cli): doctor, init, watch, changelog, timing, error cards, progress bars
Elapsed timing
- CLIContext._start records time.perf_counter() at context creation
- _ok() appends elapsed seconds to every success message automatically

Structured error cards
- _show_error_card() renders a red-bordered Rich Panel with title, detail,
  and an actionable hint line
- _ERROR_HINTS maps common exception types to fix suggestions
- _run_with_error_handling() now routes all errors through the card renderer
  instead of raising plain click.ClickException

Rich progress bars
- kg build: per-source Progress bar (SpinnerColumn + BarColumn +
  MofNCompleteColumn + TimeElapsedColumn) when multiple --source flags given;
  single-source path keeps the spinner
- ingest: spinner added (was missing entirely); shows filename and recursive flag

semantica changelog
- Hits GitHub releases API via stdlib urllib; compares latest tag against
  __version__; renders release notes in a rounded Panel; --json supported

semantica doctor
- Checks: Python version, semantica/rich versions, graph store reachability,
  vector store importability, LLM provider env vars, config file, log dir
- Rich table with ✓/⚠/✗ per check; summary error/warning count at bottom

semantica init
- Interactive wizard: graph backend, vector backend, optional LLM key
- Writes ~/.semantica/config.yaml via yaml.dump; --force to overwrite

semantica watch
- Wraps watchdog Observer; matches configurable glob patterns; auto-ingests
  on created/modified events; graceful Ctrl+C shutdown
- Guards ImportError with pip install semantica[watch] hint

_HELP_SECTIONS updated to surface init, doctor, changelog, watch
2026-06-04 17:46:00 +05:30
KaifAhmad1 3db344784d chore(pyproject): improve PyPI metadata for discoverability
- description: rewritten to lead with the accountability/provenance
  angle and name concrete capabilities; drops emoji which render
  inconsistently across PyPI clients
- keywords: expanded from 8 to 23 terms covering modern search queries
  (ai-agents, llm, graph-rag, decision-intelligence, provenance, etc.)
- classifiers: added Information Analysis, Text Processing::Linguistic,
  Database Engines/Servers, Information Technology audience
- [project.urls]: new section with Homepage, Documentation, Repository,
  Changelog, Bug Tracker, Discord — shown prominently on the PyPI page
  and drive clicks to GitHub/docs
- optional-dependencies: added watch = [watchdog>=3.0.0]; bundled into all
2026-06-04 17:37:11 +05:30
KaifAhmad1 4f1740e19c fix(cli): reconfigure stdout/stderr to UTF-8 on Windows at import time
Prevents UnicodeEncodeError on the default cp1252 code page when Rich
renders box-drawing characters and emoji in the startup banner and panels.
Placed before all other imports so Click and Rich capture the already-
reconfigured streams. Uses reconfigure() (Python 3.7+) which modifies the
existing TextIOWrapper in-place rather than replacing sys.stdout.
2026-06-04 17:18:05 +05:30
KaifAhmad1 fab300c498 feat(cli): startup dashboard, Rich help groups, and interactive shell
- _BANNER: ASCII art shown when `semantica` is run with no subcommand
- _show_startup: dashboard panel with Graph Store / Vector Store / Profile
  status cards; suppressed under --quiet and --json
- RichGroup: click.Group subclass that renders --help with grouped sections
  (Data Ingestion, Intelligence, Knowledge Graph, Analytics, Export & Viz,
  Infrastructure, Services, Tools) plus a Quick Start block
- main decorator: cls=RichGroup + invoke_without_command=True to wire both
- `semantica shell`: interactive REPL that dispatches subcommands while
  sharing the parent CLIContext; supports readline on Unix for line editing
2026-06-04 17:13:00 +05:30
KaifAhmad1 dbf6ef7b0b fix(cli): resolve JSON spinner leakage and cleanup review findings
- Guard parse_cmd spinner with `fmt == "json"` (default format) to prevent
  Rich status output from polluting machine-readable stdout in piped usage
- Remove unused `Rule` import from cli.py
- Remove unused `_orig_print` variable in verify_rich_cli.py
- Unify semantica.cli import style in verify_rich_cli.py; use cli_mod.main
2026-06-04 16:57:00 +05:30
KaifAhmad1 b821d4e7c6 fix(docs_check): make rich import optional for CI
The docs validation workflow runs python docs_check.py with no pip
install step, so rich is not available. Wrap the rich import in a
try/except ModuleNotFoundError and fall back to plain print() calls
so the script works in both environments:
- With rich installed: coloured pass/FAIL output
- Without rich (CI): plain text pass/FAIL output, same exit codes
2026-06-04 12:38:16 +05:30
KaifAhmad1 311a7b43b1 feat(cli): modern Rich terminal styling across all modules
## Summary

Overhaul the CLI and all library modules to produce polished, modern
terminal output comparable to tools like uv, gh, and cargo. Rich was
already a declared dependency but barely used — this commit wires it
throughout every layer.

## Changes by layer

### semantica/cli.py — visual overhaul
- Add imports: `box`, `Panel`, `Rule`, `Syntax`, `Text` from Rich
- Add 7 style constants (`_BRAND`, `_KEY`, `_VAL`, `_DIM`, `_SUCCESS`,
  `_WARN_STY`, `_TABLE_BOX`) for a consistent colour palette
- `_ok()` now prefixes output with a green ✓ checkmark
- New `_info()` helper (neutral · bullet, respects --quiet)
- New `_warn()` helper (yellow ⚠ prefix, never suppressed)
- New `_pprint()` helper: renders dicts/lists as syntax-highlighted JSON
  (Rich Syntax, monokai theme) instead of raw Python repr; strings
  pass through unchanged; respects --quiet
- `info` command: banner replaced with a rounded Rich Panel showing
  version + tagline; component table uses SIMPLE_HEAD box
- All 7 table sites updated: `box=SIMPLE_HEAD`, `show_edge=False`,
  consistent `_KEY`/`_VAL` column styles (KG Stats, Reasoning Engines,
  Recent Decisions, Configured Backends, Backup Info, MCP Tools)
- `_run_build()`: `console.status(spinner="dots")` wraps the blocking
  build call; skipped under --quiet / --json
- `parse`, `extract`, `embed generate`, `reason run`, `reason explain`,
  `deduplicate`: each wraps its long-running operation in a status
  spinner, guarded by --quiet / --json
- All 30+ `console.print(result)` calls replaced with `_pprint()`
- All raw `[yellow]Warning:[/yellow]` and "not running" patterns
  replaced with the new `_warn()` / `_WARN_STY` style

### semantica/explorer/__init__.py
- Error messages use `Console(stderr=True)` with `[bold red]Error:[/bold red]`
- Graph loading wrapped in `console.status()` spinner
- Startup info replaced with a cyan-bordered Rich Panel showing URL,
  API docs, and health endpoint

### Library internals — replace print() with structured logger calls
All modules below had active `print()` calls that bypassed the logging
framework, corrupted spinners, and polluted stdout in piped/programmatic
use. All replaced with appropriate `self.logger.*` calls:

- `semantica/kg/graph_builder.py` — 23 calls: entity resolution
  progress, graph structure steps, GraphStore persistence timing, and
  the two `='*60` completion banners → `self.logger.info/debug()`
- `semantica/semantic_extract/methods.py` — 4 verbose-mode debug
  prints → `logger.debug()`
- `semantica/semantic_extract/relation_extractor.py` — progress +
  error prints → `self.logger.debug/warning()` with `exc_info`
- `semantica/semantic_extract/triplet_extractor.py` — same pattern
- `semantica/semantic_extract/semantic_network_extractor.py` — batch
  error prints → `self.logger.warning/error()`
- `semantica/semantic_extract/coreference_resolver.py` — error print
  → `self.logger.error()`
- `semantica/semantic_extract/providers.py` — debug print →
  `self.logger.debug()`

### Tooling
- `benchmarks/benchmarks_runner.py`: Rule banner, ✓/✗/⚠ status lines,
  Rule separators around regression alert
- `benchmarks/infrastructure/compare.py`: removed manual ANSI escape
  codes; comparison output is now a Rich Table with SIMPLE_HEAD;
  summary uses coloured Rule + styled SUCCESS/FAILURE messages
- `cookbook/advanced/snowflake_ingestion_examples.py`: `_section()`
  helper using Rule; tabular data rendered as Rich Table; result lines
  use ✓/✗/⚠ prefixes; logger.error already present, retained
- `docs_check.py`: `pass`/`FAIL` lines use `[bold green]` /
  `[bold red]`; summary uses styled output

## Tests
- `tests/test_cli_commands.py`: fix 3 pre-existing mock mismatches
  - `test_kg_stats_json_with_mock`: mock now uses `compute_metrics()`
    (the method the code actually calls) instead of `get_statistics()`
  - `test_dry_run_not_needed_extract_is_read_only` and
    `test_stdin_input`: mock now provides `NERExtractor`,
    `RelationExtractor`, `TripletExtractor`, `EventDetector`
    (the classes the code imports) instead of `SemanticAnalyzer`
  Result: 230/230 tests pass (was 227/230)
- `tests/verify_rich_cli.py`: new verification script; exercises all
  14 command groups (92 --help checks, table rendering, dry-run
  formatting, --json mode, _pprint helper); 111 pass, 0 fail
2026-06-04 12:34:12 +05:30
KaifAhmad1andSameer Kadam b3797c11a1 fix(cli): resolve all extract and kg-stats review findings
- Wire --confidence, --model, --temporal flags to extractors via a flat
  extractor_config dict (min_confidence, llm_model, include_temporal)
  instead of the unused kwargs dict and sectioned to_dict() spread
- Pass confidence_threshold=confidence directly to RelationExtractor
  which exposes it as a named parameter alongside **config
- Remove dead SemanticAnalyzer import and unreachable else branch from
  extract; unsupported modes now consistently raise ClickException
- Add _serialize_extract_result() to convert dataclass/list results to
  plain dicts so JSON and YAML output is machine-readable, not str()
- Fix kg_stats: remove graph={} arg from compute_metrics() so it uses
  the analyzer's loaded graph instead of always computing on empty data

Co-authored-by: Sameer Kadam <sskadam6305@gmail.com>
Co-authored-by: KaifAhmad1 <kaifahmad087@gmail.com>
2026-06-03 16:50:41 +05:30
KaifAhmad1 dc24f956e9 docs: add CLI reference section to README
Covers all 22 command groups introduced in issue #568:
global flags, data in, processing, KG, intelligence (reason/decision/temporal),
provenance, validation, ontology, export, visualize, orchestration
(pipeline/store/backup), services (server/explorer/mcp), and shell completion.

Each section shows real invocation examples rather than flag tables.
2026-06-02 19:53:43 +05:30
KaifAhmad1 af697a83d8 fix(cli): resolve all review findings from PR #578
P1 — runtime-breaking API mismatches:
- decision record/list/query/trace/similar/impact/check: all six decision
  commands now call decision_methods / decision_query using a GraphStore
  from _get_graph_store(cli_ctx) instead of passing config= kwargs that
  don't exist on the underlying API signatures.
- embed index: load vectors from the Parquet/JSON file into List[np.ndarray]
  before calling create_index(), which expects vectors not a file path string.

P2 — stub implementations replaced with real logic:
- backup sync: now collects local data sources via _collect_backup_sources
  and performs an incremental copy (skips files whose dst mtime >= src mtime).
- backup restore: detects .enc / tar.gz / .tar / directory, decrypts SEM1
  format when --enc, extracts tar archives with leading prefix stripped, or
  copies directory trees back to cwd.

P3 — correctness bugs:
- backup create: archive now includes actual config/ontology/store data files
  via _collect_backup_sources; manifest records the file list.
- extract: --output now works for all formats (table/rdf/yaml), not only JSON.
- backup create: empty keyfile now raises a clear error instead of silently
  producing an unencrypted archive.
- normalize: use Path.is_file() instead of Path.exists() to avoid accidentally
  reading a directory that matches the input text.
- visualize: without --output, emit to stdout; do not silently write kg.html.

Minor:
- _setup_cli_logging: replace opaque _ = (quiet, json_output, exc) tuple
  with del to suppress unused-variable lint.
- reason list: try to source engines from the reasoning module registry;
  fall back to the hardcoded list.
- deduplicate --action report: use method="pairwise" to produce individual
  pair objects with similarity scores, distinct from --action detect.
- tests: remove mixed import (from semantica.cli import main) — all 192
  runner.invoke calls now use cli_module.main as CodeQL flagged.
- tests: add two focused embed-index regression tests that verify vectors
  are loaded from the file before create_index is called.
2026-06-02 19:35:37 +05:30
KaifAhmad1 eef5f9a850 fix(cli): resolve four runtime bugs flagged in PR #578 review
- embed search: embed query text before calling search_vectors (was passing
  raw string to query_vector positional arg, causing TypeError on every call)
- ontology version: import OntologyVersionManager not OntologyVersioning
  (symbol never existed; command always failed even with package installed)
- ingest --watch: forward watch flag into _ingest() kwargs (was accepted
  but silently dropped, so --watch had no effect)
- store migrate: replace fake success stub with honest ClickException pointing
  to the export+embed-index workaround (no bulk-dump API exists in vector store layer)
2026-06-01 11:27:59 +05:30
KaifAhmad1 ba5038a2e1 feat(cli): implement full Semantica CLI command suite (issue #568)
Expands semantica/cli.py from a 2-command stub into a complete terminal
interface covering every capability described in issue #568, and ships
253 tests covering all new commands, flags, and error paths.

Co-Authored-By: KaifAhmad1 <kaifahmad087@gmail.com>
2026-05-28 14:43:12 +05:30
KaifAhmad1andClaude Sonnet 4.6 8feb8c00c6 fix(cli): address review findings from PR #576
- Remove incorrect # pragma: no cover from _run_with_error_handling
  generic Exception branch (test_runtime_errors_are_click_safe already
  covers it via the monkeypatched RuntimeError path)

- Add _require_ctx() guard: converts None ctx.obj into a clean
  ClickException instead of an AttributeError (protects standalone_mode=False
  / library-use callers); apply to info, kg_build, build_alias commands

- Rename serve group -> services to avoid collision with the future
  `semantica server` flat command specified in issue #568; update docstring
  to document planned subcommand layout

- Fix command-level config logging: re-call setup_logging() with the
  command-level config logging section when -c is used (setup_logging
  clears handlers before adding, so no accumulation risk)

- Fix missing log_level_override in command_ctx: global --log-level was
  silently dropped when a per-command -c config was present, breaking
  the override chain for any nested _build_runtime_config calls

- Add return-shape docstring on _run_build documenting the expected
  build_knowledge_base() return dict structure

- Add type annotation to runner fixture (-> CliRunner) so Pylance
  correctly types runner.invoke() -> Result across all test functions

- Expand test suite: 25 -> 32 tests
  * test_info_command_shows_framework_components
  * test_info_command_shows_config_path_when_supplied
  * test_log_level_global_override_stores_in_context
  * test_command_config_preserves_global_log_level_override
  * test_build_result_with_stats_shows_source_count
  * test_build_result_without_stats_shows_generic_success
  * test_build_result_none_shows_generic_success
  * test_require_ctx_raises_click_exception_on_none
  * test_require_ctx_returns_ctx_unchanged

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 15:29:39 +05:30
KaifAhmad1 470315d9cb Make favicon brain icon larger — reduce inner padding to fill more space 2026-05-24 18:42:26 +05:30
KaifAhmad1 058014272a Update branding to new Semantica logo
- Rename logo PNG to semantica-logo.png (lowercase, hyphenated)
- Update docs.json logo (light/dark) and favicon to reference new PNG
- Replace legacy purple favicon with new teal brain neural network icon
2026-05-24 18:37:51 +05:30
KaifAhmad1 68fcff5b3a docs: add Exported Classes blocks to all remaining reference docs
Adds ## Exported Classes (or equivalent interface block) to:
- change_management.md, conflicts.md, context.md, embeddings.md
- graph_store.md, ingest.md, normalize.md, pipeline.md
- seed.md, split.md, triplet_store.md, vector_store.md
- visualization.md

Adds ## Launch Interface to explorer.md (CLI-only module).
Adds ## Server Interface to mcp_server.md (stdio process, not importable).

All blocks sourced from module __all__ with inline usage hints.
evals.md intentionally skipped (placeholder, __all__ = []).
2026-05-24 14:56:11 +05:30
KaifAhmad1 beacc88b02 fix(ci): replace list[Event] with List[Event] for Python 3.8 compat 2026-05-24 14:46:50 +05:30
KaifAhmad1 37e640e7b4 docs: comprehensive audit and DX overhaul of all reference modules
llms.md:
- Only Groq/OpenAI/LiteLLM/HuggingFaceLLM are exported — remove non-exported
  Anthropic/Ollama/Gemini/DeepSeek/Novita as direct imports
- Rename HuggingFace -> HuggingFaceLLM (correct class name)
- Remove non-existent create_provider() — replace with LiteLLM provider/model pattern
- Add LiteLLM 100+ providers section with provider/model string examples
- Add Exported Classes table (class -> provider -> API key)
- Update Provider Comparison table to show correct import per provider

ontology.md:
- Remove non-existent OntologyManager — replace with OntologyEngine facade
- Remove non-existent start_explorer() — replace with CLI: semantica-explorer
- SHACLValidator -> OntologyValidator (correct exported name)
- OWLExporter -> OWLGenerator (correct exported name)
- Add Exported Classes block with all 15+ exported symbols
- Add LLMOntologyGenerator section, NamespaceManager section
- Add OntologyEvaluator section with coverage/completeness metrics
- Add ingest_ontology() section
- Add versioning moved-to note (change_management module)

kg.md:
- TemporalKnowledgeGraph does not exist — replace with TemporalGraphQuery
- DistanceCalculator does not exist — replace with SimilarityCalculator
- Add Exported Classes block with all 20+ exported symbols
- Fix temporal example to use TemporalGraphQuery + TemporalVersionManager correctly
- Add SimilarityCalculator section with NodeEmbedder integration example

provenance.md:
- ActivityTracker not exported — remove; ProvenanceManager handles tracking
- Fix track_entity() signature: add source_location, source_quote params
- Fix GraphBuilderWithProvenance import: from semantica.kg, not semantica.provenance
- Add Exported Classes block with storage backends and checksum utilities
- Add SourceReference section with DOI/page/quote fields
- Add tamper-evident checksum section (compute_checksum/verify_checksum)
- Add Enable Provenance in Extractors section
- Fix duplicate heading (W3C PROV-O Export appeared twice)

reasoning.md:
- Add Exported Classes block with all engines + data types + explanation types
- Add Quick Start section
- Add Choosing an Engine comparison table
- Add InferenceResult/Explanation/ReasoningStep type annotations in examples
- Add Tip: use DatalogReasoner for recursive rules

semantic_extract.md:
- Add Exported Classes block with NamedEntityRecognizer, EventDetector, Entity,
  Relation, Event, CoreferenceChain, EntityClassifier, TemporalEventProcessor
- Add Quick Start section (one-liner extraction pipeline)
- Rename EventExtractor -> EventDetector (correct exported name)
- Clarify NERExtractor vs NamedEntityRecognizer distinction
- Add return type annotations to EventDetector example

core.md:
- Add Exported Classes block
- Add When to Use Core vs. Individual Modules decision table
- Add Tip: LifecycleManager only for long-running apps
- Fix MethodRegistry example to import build_knowledge_base correctly

parse.md:
- Add Exported Classes block with all format-specific parsers + data types
- Add DoclingParser optional import note

utils.md:
- Add Exported Classes block with logging/validation/progress/helpers/exceptions

deduplication.md:
- Add Exported Classes block with PropertyMergeRule, MergeStrategyManager,
  method_registry, and all convenience functions

export.md:
- Add Exported Classes block with all exporters, NamespaceManager,
  SemanticNetworkYAMLExporter, and all convenience functions
2026-05-24 14:41:57 +05:30
KaifAhmad1 5a7a740185 docs(context): full audit and overhaul of context.md
API fixes:
- retrieve(): top_k= -> max_results= (correct parameter name)
- remove non-existent add_decision_simple() -> use record_decision() on ContextGraph
- remove non-existent analyze_decision_influence() -> get_causal_chain() + trace_decision_explainability()
- find_precedents() returns List[Decision] not Precedent; removed .similarity attribute usage
- ContextRetriever.retrieve(): top_k -> max_results, add use_graph_expansion / min_relevance_score params
- AgentMemory.retrieve(): top_k -> max_results

New constructor params documented:
- retention_days, max_memories, max_expansion_hops, hybrid_alpha

New methods documented:
- batch_store(), forget(), update(), get_memory(), stats(), health()
- save() / load(), export() / import_data()
- conversation(), get_causal_chain(), query_decisions()
- trace_decision_explainability(), get_policy_engine()
- checkpoint(), diff_checkpoints(), flush_checkpoint()
- ContextGraph: add_nodes/add_edges (bulk), find_node, find_nodes, find_active_nodes
- ContextGraph: find_edges, query, stats, density, clear, build_from_conversations
- ContextGraph: link_graph, navigate_to, cross_graph_path, resolve_links

New sections:
- Cross-Graph Navigation with full example
- Checkpoint Methods with example
- Conversation Methods with example
- Persist and Restore real-world tab
- Policy dataclass in Data Structures accordion
- Decision.valid_from / valid_until temporal fields documented
- CausalChainAnalyzer and ContextRetriever added to What You Get cards
- New Tips: max_results param name, checkpoint auditing
2026-05-24 14:28:37 +05:30
KaifAhmad1 daa79ccef3 fix: audit and correct all remaining API mismatches in docs
- llms.md: replace non-exported Anthropic/Ollama imports with LiteLLM provider-prefix pattern; replace ReasoningEngine with Reasoner; replace create_provider with LiteLLM in YAML config example and tip
- concepts.md: replace ReasoningEngine with Reasoner/ReteEngine/GraphReasoner; fix DatalogReasoner.reason() to evaluate()/query(); replace TemporalKnowledgeGraph with TemporalGraphQuery; replace DistanceCalculator with SimilarityCalculator; replace EntityDeduplicator with DuplicateDetector/EntityMerger
- kg.md: replace non-exported build_knowledge_graph with method_registry.execute()
- semantic_extract.md: replace Anthropic import with LiteLLM
- index.md: replace Anthropic/Ollama imports with LiteLLM
- modules.md: fix TemporalKnowledgeGraph, DistanceCalculator, OntologyManager, ReasoningEngine, DatalogEngine, start_explorer, create_provider across code examples and module index table
- triplet_store.md: replace non-exported NamespacePrefixManager with semantica.ontology.NamespaceManager
2026-05-24 14:28:36 +05:30
KaifAhmad1 ce765b6f66 fix: correct docs-to-code mismatches in 8 reference modules
- graph_store: remove create_constraint(), add_nodes_bulk(), add_edges_bulk() → create_nodes(), add_edges()
- deduplication: fix PropertyMergeRule → MergeStrategy enum; add_rule() → add_property_rule(); merge() → merge_entities(); remove non-existent UNION/MAX/MIN/VOTING constants
- conflicts: set_credibility() → set_source_credibility(); group_by_severity/identify_patterns/analyze_sources → analyze_conflicts() dict keys; generate() → generate_guide(); remove time_window= param from analyze_trends()
- reasoning: infer() → forward_chain(); remove apply_transitivity/symmetry/inverse() templates that don't exist; GraphReasoner(kg) → GraphReasoner(); infer(kg) → reason(graph, query)
- split: split_document() (singular) → split_documents([parsed]) throughout
- seed: remove register_source_object(), populate(), inject(), load_from_file(), diff_versions(), get_version(tag=) — replace with register_source() and load_from_csv/json()
- change_management: remove rollback(), get_log_entry(), export_audit_trail(), get_audit_trail() — replace audit section with list_versions() + diff() pattern
- export: export_to_file() → export_to_rdf(); YAMLExporter → SemanticNetworkYAMLExporter
2026-05-24 13:36:14 +05:30
KaifAhmad1 ff43887842 fix: correct remaining API mismatches in pipeline, vector_store, and normalize docs
- pipeline.md: ParallelismManager pool_type="thread"/"process" → use_processes=False/True;
  execute_parallel() returns List[ParallelExecutionResult] not aggregate object
- vector_store.md: remove MetadataStore.add_field() (method is on MetadataSchema, not
  MetadataStore); fix tip to reference MetadataStore.update_metadata() not VectorStore
- normalize.md: Pipeline() orchestrator misuse → PipelineBuilder + ExecutionEngine pattern
2026-05-24 13:14:01 +05:30
KaifAhmad1 6f726c708f fix: remove non-existent classes and fix wrong API signatures across reference docs
- visualization.md: GraphVisualizer → KGVisualizer; fix method names (visualize_network,
  visualize_network_evolution, visualize_snapshot_comparison, visualize_temporal_patterns,
  visualize_2d_projection); remove DistanceVisualizer tab; fix start_explorer() reference
- kg.md: remove TemporalKnowledgeGraph and DistanceCalculator (don't exist); replace with
  TemporalGraphQuery and ConnectivityAnalyzer; fix query_at_time() signature
- ontology.md: remove OntologyManager, SKOSVocabulary, OntologyAligner, OntologyDiff,
  OntologyMigrator (none exist); fix SHACLValidator → OntologyValidator; fix OWLExporter
  → OWLGenerator.export_owl(); fix start_explorer() reference
- evals.md: replace entire file with coming-soon notice (module is a stub, __all__ = [])
- embeddings.md: fix EmbeddingGenerator constructor (takes config dict not model=);
  generate() → generate_embeddings(); similarity() → compare_embeddings()
- ingest.md: fix WebIngestor (rate_limit → delay, ingest() → ingest_url());
  FeedIngestor (ingest() → ingest_feed(), monitor() → monitor_feeds());
  StreamIngestor (backend= constructor → ingest_kafka/rabbitmq/kinesis/pulsar());
  DBIngestor constructor + ingest() → ingest_database(); SnowflakeIngestor.ingest() →
  ingest_query()/ingest_table(); OntologyIngestor.ingest() → ingest_ontology();
  DataSource → FileObject
- explorer.md: remove start_explorer() Python function (only CLI exists);
  replace with semantica-explorer CLI usage
- provenance.md: ActivityTracker → ProvenanceTracker in CardGroup
- semantic_extract.md: EventExtractor → EventDetector
- triplet_store.md: remove InMemoryTripletStore (doesn't exist); fix tip
- llms.md: fix providers (Anthropic/Gemini/Ollama/DeepSeek/NovitaAI → LiteLLM);
  HuggingFace → HuggingFaceLLM; remove create_provider()
2026-05-24 13:11:57 +05:30
KaifAhmad1 689d57b361 fix: correct API mismatches in pipeline, ingest, and vector_store docs
pipeline.md:
- Replace Pipeline().add_step().run() with PipelineBuilder + ExecutionEngine.execute_pipeline()
- Fix ValidationResult: result.valid (not is_valid), errors is List[str] not object list
- Fix ExecutionResult schema: success/output/metadata/metrics/errors (not PipelineResult)
- Fix ExecutionEngine: get_pipeline_status() not get_status(), progress keys completed_steps/total_steps
- Fix result.metadata['pipeline_id'] not result.pipeline_id
- Fix RetryPolicy: strategy=RetryStrategy.EXPONENTIAL not backoff='exponential'
- Fix PipelineSerializer.serialize_pipeline/deserialize_pipeline instead of pipeline.save/load
- Fix delta mode to use PipelineBuilder not Pipeline()

ingest.md:
- Replace S3Ingestor/GCSIngestor/GDriveIngestor (do not exist) with CloudStorageIngestor
- Remove MongoIngestor/DuckDBIngestor (do not exist) from docs and tables
- Fix Quick Start pipeline step to use PipelineBuilder + ExecutionEngine

vector_store.md:
- Replace store.hybrid_search() (does not exist) with HybridSearch.search()
- Replace store.add_vectors() with store.add_documents() / store.store_vectors()
- Replace store.search(query_vector) with store.search_vectors(k=) / store.search(query_str, limit=)
- Fix Batch Operations: add_vectors_batch -> add_documents, delete_vectors(vector_ids=), update_vectors()
- Fix HybridSearch.search() signature: (query, k, metadata_filter) not (query_vector, query_text, fusion, filters)
- Fix MetadataStore: store_metadata/get_metadata/update_metadata/query_metadata (not add/filter/get)
- Fix NamespaceManager: add_vector_to_namespace, list_namespaces returns List[str]
2026-05-24 12:36:21 +05:30
KaifAhmad1 d206a10bc7 docs: apply Mintlify component overhaul to index.md
- The Problem section: flat bullet list → CardGroup (5 problem cards with icons)
- The Solution section: flat bullet list → CardGroup (6 solution cards)
- Start Here section: plain prose → Steps (4-step onboarding flow)
- Built for High-Stakes Domains: plain prose → CardGroup (6 domain cards)
- Why Semantica: plain prose → CardGroup cols={3} (3 value proposition cards)
- Module Reference table: updated descriptions for seed, evals, core, utils, llms, export to match v0.5.0 source
- LLM provider class names corrected: OpenAIProvider → OpenAI, AnthropicProvider → Anthropic, OllamaProvider → Ollama
2026-05-23 23:06:49 +05:30
KaifAhmad1 5eefadaa7f docs: apply full Mintlify component overhaul to all 27 reference pages and concepts.md
Replace plain markdown in every docs/reference/ file and docs/concepts.md with
rich Mintlify JSX components — CardGroup, Steps, Tabs, AccordionGroup, Tip,
Warning, Note, and CodeGroup — for a consistent, navigable, production-grade
developer experience.
2026-05-23 23:02:03 +05:30
KaifAhmad1 f4e0d5b400 fix: update architecture.md to four-layer model — resolves diagram/text contradiction
Frontmatter, intro, heading, Tabs, and Module Map all said "three-layer"
while the architecture-overview.svg and its alt text showed four layers.
Adds Layer 3 (Intelligence: KG, vector store, ontology, triplet store,
embeddings) and renumbers the former Layer 3 Application to Layer 4.
2026-05-23 17:22:18 +05:30
KaifAhmad1 98bc2de20b docs: add SVG diagrams and Semantica wordmark logo
Diagrams (docs/assets/img/diagrams/):
- architecture-overview.svg: 4-column layered architecture
- pipeline-flow.svg: 8-step numbered pipeline flow
- kg-structure.svg: entity/relation graph with typed nodes and labeled edges
- graphrag-flow.svg: dual-path retrieval (vector + graph) to LLM to grounded answer
- extraction-pipeline.svg: NER/Relation/Coreference fan-out to Triplet Generator
- agent-context-flow.svg: AgentContext hub with VectorStore and ContextGraph
- reasoning-chain.svg: forward-chaining inference with explanation path

Wordmark logo (light + dark SVG variants):
- Green rounded-square S icon + Semantica text in green
- docs.json updated to use wordmark SVGs for light and dark modes

Pages updated with diagrams:
- index.md, architecture.md, quickstart.md, concepts.md
- reference/kg.md, reference/pipeline.md, reference/semantic_extract.md
- reference/context.md, reference/reasoning.md
2026-05-23 17:04:52 +05:30
KaifAhmad1 6bf81bb5bc fix: correct docs-to-code mismatches in modules.md, context.md, and split.md
- Replace APIIngestor with RESTIngestor (actual exported class name)
- Update TextSplitter method names: semantic->semantic_transformer, entity-aware->entity_aware, relation-aware->relation_aware
- Fix TextSplitter parameter: overlap->chunk_overlap throughout split.md and modules.md
- Replace DataNormalizer (not exported) with TextNormalizer + normalize_date convenience function
- Fix AgentContext defaults: graph_expansion, advanced_analytics, kg_algorithms are True not False
2026-05-23 13:57:48 +05:30
KaifAhmad1 51b1e7fffd docs: add 'What You Get' sections to explorer, llms, and mcp_server 2026-05-23 13:17:36 +05:30
KaifAhmad1 9113ef3428 docs: premium overhaul of all reference pages and core docs
- Rewrote all 26 reference module pages: removed blockquote taglines and
  horizontal rule separators, added "What You Get" bullet summaries,
  added constructor/method parameter tables, expanded thin files
  (graph_store, triplet_store, visualization, provenance) with full API
  coverage, added backend comparison tables and real-world usage patterns
- Renamed Modules tab from "API Reference" and group from "Context &
  Knowledge" to "Context & Intelligence" in docs.json
- Fixed logo: copied "Semantica Logo.png" to web-safe semantica-logo.png
  and updated all 4 references in docs.json
- Improved core docs (index, modules, concepts, quickstart, installation,
  getting-started) with better fonts, bullet points, and complete module
  listings (mcp_server, evals, core, utils previously missing)
- Rewrote community pages (community, community-projects, contributing-guide,
  use-cases, architecture, faq, learning-more, glossary) with heading
  hierarchy fixes, expanded definitions, and better structure
- Fixed markdown linter warnings: MD036 bold-as-heading, MD001 heading
  skips, MD040 missing code fence language, MD032 blank lines around lists
2026-05-23 13:10:09 +05:30
KaifAhmad1 c190ecb81e docs: fix review follow-ups — naming consistency, extras snippet, nav card order
- installation.md: revert card title back to "Getting Started" to match
  the Tip text that already links to it by that name
- getting-started.md: restore pip install semantica[all] code block that
  was removed in the original PR; users need the copy-paste snippet even
  when the Installation guide is the canonical reference; also standardize
  link text to "Installation" (was "Installation guide")
- index.md: add Installation card as first entry in "Start Here" CardGroup
  so the prose ("install first, then open Quickstart") is backed by an
  actual card to click
- quickstart.md: standardize link text to "Installation" (was "Installation guide")
2026-05-23 11:36:58 +05:30
KaifAhmad1 453eeb7ca9 fix: rename contributing/license pages to avoid Mintlify reserved slug conflict
mint export fails with 'file does not exist' for pages named 'contributing'
and 'license' — these are reserved by Mintlify's GitHub integration layer.
Renamed to contributing-guide.md and project-license.md and updated all
nav entries and cross-links throughout the docs.

Also adds .gitattributes LF rules to prevent CRLF issues from Windows devs.
2026-05-23 00:14:23 +05:30
KaifAhmad1 f4a79ae851 ci: disable automatic benchmark runs on push — manual only via workflow_dispatch 2026-05-23 00:04:52 +05:30