|
|
|
English | ZH-CN
π§ BeliefSync gives coding agents a repository-state sync layer: explicit beliefs, stale-belief detection, targeted revalidation, git-aware scans, and reportable recovery state.
βοΈ Build with the project: make coding agents more inspectable, more stable in dynamic repositories, and less dependent on brute-force context rescans.
Coding agents are already good at producing patches in static snapshots.
They are much worse at one quieter but much more realistic failure mode π
- π a commit lands while the agent is still reasoning from an older snapshot
- π§ͺ a test changes what βcorrectβ means
- π¬ an issue comment narrows the requirement
- π¦ a dependency update invalidates an earlier hypothesis
Most stacks answer that problem by rescanning more repository context π΅
BeliefSync takes a different view:
the problem is not only missing context, but stale repository beliefs.
So instead of hiding state inside prompt history, BeliefSync:
- π§© turns working assumptions into explicit repository-state beliefs
- π attaches evidence, scope, and version validity to each belief
- π¨ detects which beliefs likely became stale after repository events
- π― recommends low-cost revalidation actions before the agent keeps editing code
This makes BeliefSync useful as:
- π‘οΈ a reliability layer for coding agents
- π a debugging and observability tool for agent runs
- π§ͺ a project-first foundation for stale-belief research in software engineering agents
π Repository events become explicit beliefs, stale assessments, and targeted recovery actions.
BeliefSync is built around one architectural bet π§
coding agents need an explicit repository-state layer, not just longer prompt history.
The runtime core is intentionally simple and visible:
Belief Constructorπ§- extracts candidate beliefs from issue text, test logs, and repository context
Belief StoreποΈ- persists repository-state claims with scope, evidence, and version metadata
Stale Belief Detectorπ¨- scores which beliefs likely drifted after repository changes
Revalidation Plannerπ―- converts stale beliefs into low-cost, high-value recovery actions
Task Agent Adapterπ€- feeds the cleaned state back into a coding-agent loop
The design is deliberately:
agent-agnosticπ- BeliefSync can sit beside different coding-agent runtimes
inspectableπ- beliefs are stored as explicit JSON, not hidden in opaque traces
project-first, research-readyπ§ͺ- useful as an open-source reliability tool while still structured enough for benchmark and paper work later
| Item | Why It Matters |
|---|---|
Python 3.10+ |
required for the CLI, belief models, reports, and repository scanning |
git |
used for repository-event ingestion and refresh workflows |
| optional OpenAI-compatible provider | used for llm-smoke-test and llm-extract |
git clone https://github.com/xiao-zi-chen/Beliefsync.git
cd Beliefsync
python -m pip install -e .python -m beliefsync demopython -m beliefsync init --repo-id demo/repo
python -m beliefsync status
python -m beliefsync show-configpython -m beliefsync snapshot ^
--repo-id demo/repo ^
--repo-path . ^
--issue-file examples/demo_issue.md ^
--test-log examples/demo_test_log.txtpython -m beliefsync scan ^
--repo-id demo/repo ^
--repo-path . ^
--issue-file examples/demo_issue.md ^
--test-log examples/demo_test_log.txt ^
--base-ref HEAD~1 ^
--head-ref HEADpython -m beliefsync refresh ^
--repo-path . ^
--head-ref HEAD ^
--format markdownBeliefSync is not just a one-shot CLI. It now supports a small but real workspace lifecycle β¨
beliefsync initποΈ- create
.beliefsync/
- create
beliefsync snapshotπΈ- store the current belief baseline
- repository changes happen π
beliefsync refreshπ¨- compare the last belief baseline against new repository events
- BeliefSync emits:
- stale-belief assessments
- targeted revalidation actions
- text / JSON / Markdown / HTML reports
- the refreshed beliefs become the next baseline β»οΈ
That workflow makes BeliefSync feel like a practical tool rather than a one-off demo:
- π§ you can keep a local belief baseline in
.beliefsync/beliefs.json - π§Ύ you can inspect workspace state via
.beliefsync/state.json - π you can keep report history under
.beliefsync/reports/
This is the shape of a real βagent reliability sidecar,β not just a benchmark script π‘
BeliefSync already supports OpenAI-compatible LLM access, including Kimi-compatible usage β
Generic:
BELIEFSYNC_LLM_API_KEYBELIEFSYNC_LLM_BASE_URLBELIEFSYNC_LLM_MODELBELIEFSYNC_LLM_TIMEOUT
Kimi aliases:
KIMI_API_KEYKIMI_BASE_URLKIMI_MODEL
You can start from .env.example.
python -m beliefsync llm-smoke-testThis command:
- π lists available models from the provider
- β‘ performs a tiny completion request
- π retries on transient overload
- π§ falls back to reasonable OpenAI-compatible model choices when possible
python -m beliefsync llm-extract ^
--repo-id demo/repo ^
--issue-file examples/demo_issue.md ^
--test-log examples/demo_test_log.txt ^
--output .beliefsync/llm_beliefs.jsonThis is useful when you want richer candidate beliefs than the purely heuristic extractor.
BeliefSync currently exposes 16 CLI commands:
| Command | Purpose |
|---|---|
init |
initialize a .beliefsync/ workspace |
status |
inspect workspace state |
show-config |
print the active config |
snapshot |
create a baseline belief snapshot |
refresh |
re-run stale-belief analysis against new repository changes |
llm-smoke-test |
test OpenAI-compatible/Kimi connectivity |
llm-extract |
extract candidate beliefs with an LLM |
demo |
run the built-in end-to-end example |
extract |
heuristic belief extraction |
detect |
stale-belief detection |
plan |
targeted revalidation planning |
report |
produce text / JSON / Markdown / HTML reports |
ingest-git |
turn a git diff into repository events |
scan |
run extract + ingest + report in one workflow |
validate-beliefs |
validate belief JSON files |
validate-events |
validate event JSON files |
This is enough to make the repository immediately useful for:
- π§ͺ local developer experiments
- π€ coding-agent wrappers
- π§Ύ report-first debugging workflows
- π future adapter work with OpenHands or SWE-agent
BeliefSync is compact on purpose, but it already has a meaningful open-source surface:
| Surface | Count | What It Gives You |
|---|---|---|
| CLI commands | 16 | end-to-end workflows, validation, LLM integration |
| belief types | 5 | bug localization, API contract, test expectation, requirement, dependency |
| report formats | 4 | text, json, markdown, html |
| adapters | 2 | OpenHands and SWE-agent placeholders for future integration |
| tests | 13 | baseline regression coverage |
| runtime dependencies | 0 | standard-library-first baseline |
That combination is a big part of the projectβs identity:
- π§± serious enough to be useful
- π simple enough to inspect
- π± structured enough to extend
Beliefsync/
.github/
assets/
workflows/
docs/
examples/
src/beliefsync/
tests/
README.md
README.zh-CN.md
pyproject.toml
Important paths:
The next steps are not βmake the README prettier again.β
They are product and integration steps:
- 𧬠richer symbol-level scope extraction
- πͺ better git-native event parsing
- π§ learned stale-belief detectors
- π€ OpenHands and SWE-agent integration
- β±οΈ watch / hook driven workflows
- π richer dashboards for belief drift and recovery actions
BeliefSync should grow into:
a real reliability layer for coding agents operating in changing repositories.
If you want to help, the most valuable contributions right now are:
- π§Ύ real repository traces
- π¨ stale-belief failure cases
- π§© better event parsers
- π¨ stronger report UX
- π coding-agent integrations
See CONTRIBUTING.md, SECURITY.md, and CODE_OF_CONDUCT.md.
MIT. See LICENSE.
