diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e943802 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Release + +# Cuts a GitHub release (and its tag) from a chosen commit. +# Run it from the Actions tab or via the API with: +# version: "0.4.0" -> tag v0.4.0, must match pyproject.toml +# title: "The Site Archive" (optional codename appended to the release name) +# target: "main" (branch or commit SHA the tag points at) +# Release notes are read from docs/releases/v.md. + +on: + workflow_dispatch: + inputs: + version: + description: "Version to release (e.g. 0.4.0)" + required: true + title: + description: "Optional codename, e.g. The Site Archive" + required: false + default: "" + target: + description: "Branch or commit SHA to tag" + required: false + default: "main" + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.target }} + fetch-depth: 0 + + - name: Check that pyproject.toml carries the version + run: | + grep -q "^version = \"${{ inputs.version }}\"" pyproject.toml \ + || { echo "pyproject.toml does not declare version ${{ inputs.version }}"; exit 1; } + test -f "docs/releases/v${{ inputs.version }}.md" \ + || { echo "docs/releases/v${{ inputs.version }}.md is missing"; exit 1; } + + - name: Create tag and GitHub release + env: + GH_TOKEN: ${{ github.token }} + run: | + name="archaeocode v${{ inputs.version }}" + if [ -n "${{ inputs.title }}" ]; then name="$name — ${{ inputs.title }}"; fi + gh release create "v${{ inputs.version }}" \ + --repo "${{ github.repository }}" \ + --target "$(git rev-parse HEAD)" \ + --title "$name" \ + --notes-file "docs/releases/v${{ inputs.version }}.md" diff --git a/docs/releases/v0.4.0.md b/docs/releases/v0.4.0.md new file mode 100644 index 0000000..eadec1f --- /dev/null +++ b/docs/releases/v0.4.0.md @@ -0,0 +1,35 @@ +**archaeocode** — automated software archaeology. Release 0.4.0, "The Site Archive". + +Until now every dig ended with a JSON report and amnesia. This release gives archaeocode a memory: a persistent, queryable **knowledge base** built on [LightRAG](https://github.com/HKUDS/LightRAG) (GraphRAG: knowledge graph + vector retrieval). Files, AST entities, dependency edges, and user stories become a graph you can interrogate from the terminal, from any MCP-capable agent, or as an Obsidian-style wiki. + +## Highlights + +- **Knowledge base workflow step** (`archaeo --knowledge-base`): files, classes, functions, methods, import/call edges with circular-dependency markers, and user stories are written into the graph **without a single LLM call**. Exact, cheap, idempotent. +- **Business vocabulary on demand** (`--kb-extract`): with an API key, LightRAG's entity/relation extraction mines the code for customers, tariffs, invoice runs and files them next to the technical entities. +- **`archaeo-kb` CLI**: `query`, `retrieve`, `context`, `graph`, `stats`, `add`, `wiki`. Only `query` needs an LLM; everything else works offline. +- **`knowledge-base` MCP server** with `kb_query`, `kb_retrieve`, `kb_context`, `kb_graph`, `kb_stats`, `kb_add_documents`, `kb_export_wiki`, so Claude Desktop, Claude Code, or your own agent can ask the archive instead of re-reading the code. +- **Obsidian-compatible wiki export** (`--kb-wiki DIR`): one cross-linked page per file, function, dependency, and user story. +- **Scale by configuration**: NetworkX + nano-vectordb on a laptop with zero infrastructure; Neo4j / PostgreSQL+pgvector / Qdrant / Milvus / Redis for estates the size of a bank; workspaces keep several systems apart in one back-end. Embeddings via sentence-transformers (local, default), OpenAI, or Ollama; LLM via Anthropic, OpenAI, or Ollama. +- **Air-gapped mode**: `KB_TOKENIZER=bytes` and `KB_EMBEDDING_PROVIDER=hashing` run the whole pipeline with no network. The new test suite runs this way in CI. +- **Docs, retold as a dig**: README field guide, quickstart, and the [knowledge-management decision record](https://github.com/osick/archaeocode/blob/main/docs/KNOWLEDGE_MANAGEMENT.md) explaining why GraphRAG over an LLM wiki or vanilla RAG, and why LightRAG over Microsoft GraphRAG, Cognee, Graphiti, and neo4j-graphrag. + +## Getting started + +```bash +git clone https://github.com/osick/archaeocode.git +cd archaeocode +pip install -r requirements.txt +pip install -e . # puts archaeo and archaeo-kb on your PATH +cp .env.example .env # add ANTHROPIC_API_KEY for user stories and answers + +archaeo --source sample_data/cobol --source-lang cobol --knowledge-base --kb-wiki ./wiki +archaeo-kb retrieve "PAYMENT" --mode local +archaeo-kb query "Which programs touch the customer master file?" +``` + +## Changed + +- AST entities now carry `file_path`, so classes, functions, and methods link to their file. +- `requirements.txt` adds `lightrag-hku`. + +Full change history: [docs/CHANGELOG.md](https://github.com/osick/archaeocode/blob/main/docs/CHANGELOG.md)