Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
889901b
feat: update dependencies and enhance type checking for llama-index
BasuruK Sep 22, 2026
4ab319e
fix: restrict openai dependency version to avoid breaking changes
BasuruK Sep 22, 2026
ae4ca05
feat: enhance documents schema and add compiler tests
BasuruK Sep 22, 2026
aab25e3
test: add new tests for error handling in extraction process
BasuruK Sep 22, 2026
95808d7
feat: add release function for lease management in database
BasuruK Sep 22, 2026
e4fc829
feat: implement compiler for schema-validated typed triples with prov…
BasuruK Sep 22, 2026
9fb3d45
refactor: streamline compiler and extraction logic for improved clarity
BasuruK Sep 22, 2026
a46ada3
fix: improve error handling in compile_pending function
BasuruK Sep 22, 2026
ec6ce5b
feat: add GitHub Actions workflow for OpenCodeReview PR review
BasuruK Sep 23, 2026
9415413
feat: enhance GitHub Actions workflow for OpenCodeReview
BasuruK Sep 23, 2026
15c351f
chore: update OpenCodeReview action version in workflow
BasuruK Sep 23, 2026
51fad01
fix: enhance error handling in enrich_and_serialize and release funct…
BasuruK Sep 23, 2026
aa5556c
fix: update compile_pending to select the latest reviewed source version
BasuruK Sep 23, 2026
f5dc23a
chore: add llm_extra_body configuration to ocr_review workflow
BasuruK Sep 24, 2026
5ca5af4
fix: pin llama-index-llms-openai-like dependency version
BasuruK Sep 24, 2026
4f0ccca
fix: enforce schema validation in knowledge graph labels
BasuruK Sep 24, 2026
e31726c
fix: update permissions for pull requests in ocr_review workflow
BasuruK Sep 26, 2026
56cc558
fix: refine comment handling in ocr_review workflow
BasuruK Sep 26, 2026
15946ab
fix: enhance pull request validation in ocr_review workflow
BasuruK Sep 26, 2026
1ec42ff
fix: update LLM configuration in ocr_review workflow
BasuruK Sep 26, 2026
dc85ee8
fix: update LLM authentication token in ocr_review workflow
BasuruK Sep 26, 2026
29c3a39
fix: improve base reference validation in ocr_review workflow
BasuruK Sep 26, 2026
d9ca659
Merge branch 'master' into feature/basuruk/NU-008-SchemaLLMPathExtrac…
BasuruK Sep 26, 2026
442459c
fix: add LLM token validation in ocr_review workflow
BasuruK Sep 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions .github/workflows/ocr_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ jobs:
|| github.event.comment.author_association == 'MEMBER'
|| github.event.comment.author_association == 'COLLABORATOR'
)
&& startsWith(github.event.comment.body, '/open-code-review')
&& (
Comment thread
BasuruK marked this conversation as resolved.
github.event.comment.body == '/open-code-review'
|| startsWith(github.event.comment.body, '/open-code-review ')
)
)
)
&& format('ocr-{0}', github.event.pull_request.number || github.event.issue.number)
Expand All @@ -48,7 +51,10 @@ jobs:
|| github.event.comment.author_association == 'MEMBER'
|| github.event.comment.author_association == 'COLLABORATOR'
)
&& startsWith(github.event.comment.body, '/open-code-review')
&& (
github.event.comment.body == '/open-code-review'
|| startsWith(github.event.comment.body, '/open-code-review ')
)
)
steps:
- name: Get GitHub App Token
Expand All @@ -57,6 +63,7 @@ jobs:
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
Comment thread
BasuruK marked this conversation as resolved.
permission-pull-requests: write

- name: Resolve comment PR refs
id: pr-context
Expand All @@ -73,18 +80,42 @@ jobs:
;;
esac
pr="$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}")"
state="$(jq -er .state <<<"$pr")"
if [[ "$state" != "open" ]]; then
echo "Pull request is not open (state=${state})" >&2
exit 1
fi
base_ref="$(jq -er .base.ref <<<"$pr")"
head_sha="$(jq -er .head.sha <<<"$pr")"
if ! git check-ref-format "refs/heads/${base_ref}"; then
Comment thread
BasuruK marked this conversation as resolved.
echo "Pull request base ref has an unexpected shape" >&2
exit 1
fi
if [[ ! "$head_sha" =~ ^[0-9a-f]{40}$ ]]; then
echo "Pull request head SHA has an unexpected shape" >&2
exit 1
fi
echo "base_ref=${base_ref}" >> "$GITHUB_OUTPUT"
echo "head_sha=${head_sha}" >> "$GITHUB_OUTPUT"
Comment thread
BasuruK marked this conversation as resolved.

- name: Require LLM token
env:
OCR_LLM_TOKEN: ${{ secrets.OCR_LLM_TOKEN }}
run: |
if [ -z "$OCR_LLM_TOKEN" ]; then
echo "::error::OCR_LLM_TOKEN secret is empty; the review cannot authenticate against the LLM endpoint (fork pull requests never receive secrets)"
exit 1
fi

- uses: alibaba/open-code-review@bccbc15f785269400735d5255540c231e6c02b6d # v1.12.9
with:
github_token: ${{ steps.app-token.outputs.token }}
ocr_version: "1.12.9"
base_ref: ${{ steps.pr-context.outputs.base_ref }}
head_sha: ${{ steps.pr-context.outputs.head_sha }}
llm_url: ${{ secrets.OCR_LLM_URL }}
llm_auth_token: ${{ secrets.OCR_LLM_AUTH_TOKEN }}
llm_auth_token: ${{ secrets.OCR_LLM_TOKEN }}
llm_model: ${{ vars.OCR_LLM_MODEL }}
llm_use_anthropic: ${{ vars.OCR_LLM_USE_ANTHROPIC }}
llm_protocol: openai
llm_use_anthropic: "false"
llm_extra_body: '{"reasoning":{"enabled":true}}'
Comment thread
BasuruK marked this conversation as resolved.
3 changes: 3 additions & 0 deletions schema/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ CREATE TABLE nuron_ai.documents (
document_date DATE,
tags TEXT[] NOT NULL DEFAULT '{}',
body TEXT,
compiled_graph JSONB,

created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
Expand All @@ -107,6 +108,8 @@ COMMENT ON COLUMN nuron_ai.documents.content_hash IS
'sha256(bytes), hex-encoded. Document identity and the RustFS object key {hash[0:2]}/{hash} (ADR-0005) -- never a UUID.';
COMMENT ON COLUMN nuron_ai.documents.lease_token IS
'Incremented on every claim. The state-transition UPDATE is conditioned on (claimed_by, lease_token) so a reclaimed lease cannot advance the row out from under its new holder.';
COMMENT ON COLUMN nuron_ai.documents.compiled_graph IS
'Compiler output: {"nodes": [...], "relations": [...], "decisions": [node_key, ...]}, each node/relation carrying its enrichment (author/author_source/timestamp on Decision nodes, evidence_span on Evidence nodes, a provenance ref on every node).';

-- Immutable, versioned snapshot frozen at review-gate-1 approval. This, not the raw
-- file, is the Evidence root that evidence_span offsets resolve into (CONTEXT.md).
Expand Down
5 changes: 4 additions & 1 deletion services/nuron-ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ dependencies = [
"defusedxml>=0.7.1",
"fsspec>=2026.7.0",
"llama-cloud>=1.0",
"llama-index-core==0.14.23",
"llama-index-llms-openai-like==0.8.0",
"openai>=2.54.0,<3",
Comment thread
BasuruK marked this conversation as resolved.
"psycopg[binary]>=3.3.5",
"s3fs>=2026.7.0",
]
Expand All @@ -27,7 +30,7 @@ dev = [

[[tool.mypy.overrides]]
# These libraries ship no py.typed marker; nothing to check against.
module = ["defusedxml.*", "fsspec.*"]
module = ["defusedxml.*", "fsspec.*", "llama_index.llms.openai_like.*"]
ignore_missing_imports = true


Expand Down
Loading
Loading