provozni zaloha

This commit is contained in:
lachtan
2026-06-24 08:11:12 +02:00
parent 9295dba19f
commit 1db3ec4756
97 changed files with 7698 additions and 817 deletions

View File

@@ -0,0 +1,113 @@
# Wiki Schema
This file is the configuration for this wiki. It documents the conventions, page types, tag taxonomy, and any workflow customizations. The LLM reads this first when entering the wiki, and its conventions override the defaults documented in the `llm-wiki` skill.
This file is **co-evolved with the user**. When the LLM notices a recurring pattern in your edits or feedback that isn't here, it will propose adding it. When something here stops fitting, prune it.
## Wiki location
- Wiki root: `wiki/`
- Raw sources: `raw/`
- Asset/image storage: `raw/assets/`
## Page types
This wiki uses these page types, each with a dedicated subdirectory:
- `source` (in `wiki/sources/`) — one summary page per ingested source.
- `entity` (in `wiki/entities/`) — pages about specific things: people, papers, products, places, organizations.
- `concept` (in `wiki/concepts/`) — pages about ideas, methods, frameworks, abstractions.
- `synthesis` (in `wiki/synthesis/`) — cross-cutting analyses, comparisons, query answers filed back.
Add additional types here as the wiki evolves.
## Tag taxonomy
(Empty initially. Add tags here as you adopt them, with one-line descriptions. Keep this list small and disciplined — a wiki with 200 tags has effectively no tags.)
Example structure:
- `methodology` — pages about research or analytical methods.
- `open-question` — pages or sections that flag unresolved questions.
- `contested` — pages where sources contradict.
## Page sizing
- Soft cap: 400 lines / ~2,000 words. Consider splitting beyond this.
- Hard cap: 800 lines. Must split.
## Frontmatter requirements
Every page must have:
- `type`
- `title`
- `tags`
- `created`
- `updated`
Plus type-specific:
- `source` pages: `authors`, `url` (if applicable), `raw`, `ingested`
- Non-source pages: `sources` listing the source-summary pages drawn from
## Optional graph metadata
Pages may declare typed graph metadata under a top-level `graph:` key. This is the source of truth for the compiled knowledge graph under `wiki/graph/`. Markdown remains canonical; the graph is a regenerable index. Pages without `graph:` still appear as nodes (derived from `type`/`kind`) and still contribute `mentions` edges from body `[[wikilinks]]`.
```yaml
graph:
node_id: person:praney-behl # optional; default <node_type>:<slug>
node_type: person # optional; default mapped from type/kind via ontology
canonical: true # mark as canonical when multiple slugs alias the same entity
aliases: [Praney, praney@example.com]
relationships:
- predicate: founded
object: company:seedblocks
source: praney-founder-context-dump # source-page slug
evidence: "Solo technical founder and sole director..."
confidence: high # high | medium | low
status: current # current | historical | proposed | disputed | superseded
# optional:
# valid_from: 2025-01-15
# valid_to: 2026-03-01
# notes: "..."
# raw_ref: "raw/founder-dump.md#L42"
# contradicts: edge-id-or-source-slug
# supersedes: edge-id-or-source-slug
```
Required fields on every relationship: `predicate`, `object`, `source`, `evidence`, `confidence`, `status`. Predicates and the subject/object types they accept are declared in `wiki/graph/ontology.yaml`. Typed semantic edges must be supported by an explicit source — never emit one inferred from training data alone.
## Index structure
(Update this section when sharding.)
Currently flat: a single `wiki/index.md` listing all pages.
When the wiki passes ~150 pages or `index.md` exceeds 300 lines, shard into `wiki/indexes/<type>.md` and update this section.
## Graph layer
The wiki has an optional compiled graph layer under `wiki/graph/`:
- `wiki/graph/ontology.yaml` — declares node types and predicates. **Tracked.** Edit this when you introduce new predicates or domain types.
- `wiki/graph/nodes.jsonl`, `wiki/graph/edges.jsonl` — generated. Track in git only if you want graph diffs in PRs.
- `wiki/graph/graph.sqlite` — generated. Gitignored by default.
- `wiki/graph/graph.graphml` — generated. Track only if you want to diff it.
Generation is reproducible from markdown via `scripts/wiki_graph_extract.py`. The graph can be deleted at any time and rebuilt without losing knowledge — markdown is canonical.
## Workflow customizations
(Empty initially. Document any deviations from the default ingest/query/lint workflows here.)
## User preferences
(Empty initially. As the user expresses style preferences — "always include a 'Why this matters' section on concept pages", "never use bullet lists in summaries", "prefer comparative tables for synthesis pages" — capture them here so they persist across sessions.)
## Lint cadence
- Structural lint: after every 5 ingests.
- Semantic lint: weekly or after every 20 ingests.
- Gap-finding: monthly.
- Graph lint + extract: after every ingest that adds typed `graph.relationships`.
Adjust based on the wiki's growth rate.

View File

@@ -0,0 +1,32 @@
# Wiki Graph Layer
This directory holds the compiled knowledge graph derived from the markdown
wiki. **Markdown is canonical.** Everything here can be deleted and rebuilt
without losing knowledge:
```bash
python scripts/wiki_graph_extract.py wiki/ --out wiki/graph
```
## Files
| File | Purpose | Tracking |
|------|---------|----------|
| `ontology.yaml` | Declares node types and predicates the graph recognises. The contract `wiki_graph_lint.py` validates against. | **Tracked. Edit by hand.** |
| `nodes.jsonl` | One JSON object per node, sorted by id. | Generated. Track if you want graph diffs in PRs; otherwise gitignore. |
| `edges.jsonl` | One JSON object per edge, sorted by id. Includes typed semantic edges, `mentions`, `sourced_from`, and `summarizes_raw`. | Generated. Same trade-off as `nodes.jsonl`. |
| `graph.sqlite` | Queryable index used by `wiki_graph_query.py`. Schema: `nodes`, `aliases`, `edges`. | Generated. **Gitignored** — rebuild on demand. |
| `graph.graphml` | GraphML export for tools like Gephi or yEd. | Generated. Gitignored by default. |
## Workflow
1. Author or edit a wiki page. Add typed `graph.relationships` only when an explicit source supports them.
2. Run `python scripts/wiki_graph_lint.py wiki/` — catches unknown predicates, broken object references, missing evidence, alias collisions.
3. Run `python scripts/wiki_graph_extract.py wiki/ --out wiki/graph` — regenerates the artifacts above.
4. Query with `python scripts/wiki_graph_query.py wiki/ neighbors --node product:konvy` (or `edges`, `path`, `facts`).
## Anti-patterns
- **Hand-editing `nodes.jsonl` / `edges.jsonl` / `graph.sqlite`.** Edit the markdown; regenerate.
- **Treating graph rows as evidence.** They accelerate navigation. For high-stakes claims, follow the edge's `source` and `evidence` fields back to the wiki page and the raw source.
- **Adding typed edges the source doesn't support.** Use a normal `[[wikilink]]` instead — the `mentions` edge captures the connection without overclaiming.

View File

@@ -0,0 +1,2 @@
graph.sqlite
graph.graphml

View File

@@ -0,0 +1,25 @@
# Wiki Index
The catalog of all pages in this wiki. Each entry: a wikilink to the page and a one-line summary. The LLM reads this first when answering queries to identify candidate pages.
Keep summaries tight — one line each. The index is engineered to be cheap to read; a fat index defeats its purpose.
When this file exceeds ~300 lines or the wiki passes ~150 pages, shard into `wiki/indexes/<type>.md` and replace this file with a directory of shards. See the `scaling-playbook.md` reference in the `llm-wiki` skill for the migration procedure.
---
## Sources
(populated as sources are ingested)
## Entities
(populated as entity pages are created)
## Concepts
(populated as concept pages are created)
## Synthesis
(populated as query answers are filed back)

View File

@@ -0,0 +1,12 @@
# Wiki Log
Append-only chronological record of operations on the wiki. Each entry begins with `## [YYYY-MM-DD] <op> | <description>` so it's parseable with `grep "^## \[" log.md | tail -N`.
Operations:
- `ingest` — a source was processed into the wiki.
- `query` — a question was answered against the wiki (typically only logged when the answer was filed back as synthesis).
- `lint` — a health check was run.
- `schema` — the schema was modified.
- `shard` — an index was sharded.
---

View File

@@ -0,0 +1,123 @@
# Wiki Graph Ontology
#
# Declares the node types and predicates that the compiled graph layer
# (wiki/graph/) recognises. Edit this file when you introduce a new
# domain-specific predicate or node type — wiki_graph_lint.py reads it
# to validate every typed edge declared in page frontmatter.
#
# Markdown remains canonical. This file is just the contract that makes
# the graph layer machine-checkable.
node_types:
person:
maps_from:
type: entity
kind: person
company:
maps_from:
type: entity
kind: company
product:
maps_from:
type: entity
kind: product
paper:
maps_from:
type: entity
kind: paper
place:
maps_from:
type: entity
kind: place
organization:
maps_from:
type: entity
kind: organization
concept:
maps_from:
type: concept
source:
maps_from:
type: source
synthesis:
maps_from:
type: synthesis
decision:
explicit_only: true
claim:
explicit_only: true
raw:
explicit_only: true
predicates:
# --- Implicit predicates emitted by the extractor. ---
mentions:
subject_types: ["*"]
object_types: ["*"]
requires_evidence: false
description: |
Low-specificity edge derived from body wikilinks. Use it for
navigation, not as evidence of a typed relationship.
sourced_from:
subject_types: ["*"]
object_types: [source]
requires_evidence: false
description: |
Derived from each non-source page's frontmatter `sources:` list.
summarizes_raw:
subject_types: [source]
object_types: ["*"]
requires_evidence: false
description: |
Derived from a source page's frontmatter `raw:` field. Object is
the raw file path string, not a wiki node id.
# --- Typed semantic predicates. Add domain-specific ones below. ---
founded:
subject_types: [person]
object_types: [company, organization]
requires_evidence: true
owns:
subject_types: [person, company, organization]
object_types: [company, product, organization]
requires_evidence: true
contains_product:
subject_types: [company, organization]
object_types: [product]
requires_evidence: true
works_on:
subject_types: [person]
object_types: [product, concept]
requires_evidence: true
chose:
subject_types: [person, company, organization]
object_types: [product, concept]
requires_evidence: true
proposed:
subject_types: [person]
object_types: [decision, claim]
requires_evidence: true
competes_with:
subject_types: [product, company, organization]
object_types: [product, company, organization]
requires_evidence: true
depends_on:
subject_types: [product, concept]
object_types: [product, concept]
requires_evidence: true
authored:
subject_types: [person, organization]
object_types: [paper, source]
requires_evidence: true
cites:
subject_types: [paper, source, synthesis]
object_types: [paper, source]
requires_evidence: true
contradicts:
subject_types: [claim, source, synthesis]
object_types: [claim, source, synthesis]
requires_evidence: true
supersedes:
subject_types: [claim, source, decision]
object_types: [claim, source, decision]
requires_evidence: true

View File

@@ -0,0 +1,26 @@
---
type: <source|entity|concept|synthesis>
title: ""
tags: []
sources: []
created: YYYY-MM-DD
updated: YYYY-MM-DD
---
# Title
Lead paragraph: a clear, encyclopedic definition or framing of what this page is about. Should answer "what is this and why does it matter" in one or two sentences.
## Section 1
Body content. Use `[[wikilinks]]` liberally to cross-reference other pages. (Frontmatter `sources:` list above uses bare slugs; only the body uses double-bracket wikilinks.)
## Section 2
More body content. Hedge claims that aren't yet corroborated by multiple sources ("Source X claims Y, though this is not yet corroborated by other sources in the wiki").
## Where this fits
(For source pages.) List the entity and concept pages this source touches:
- [[entity-page-1]]
- [[concept-page-1]]