@izagood/avcs 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +221 -0
- package/dist/api/repo.d.ts +616 -0
- package/dist/api/repo.d.ts.map +1 -0
- package/dist/api/repo.js +1772 -0
- package/dist/api/repo.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +660 -0
- package/dist/cli.js.map +1 -0
- package/dist/concurrency/lease.d.ts +27 -0
- package/dist/concurrency/lease.d.ts.map +1 -0
- package/dist/concurrency/lease.js +63 -0
- package/dist/concurrency/lease.js.map +1 -0
- package/dist/core/canonical.d.ts +16 -0
- package/dist/core/canonical.d.ts.map +1 -0
- package/dist/core/canonical.js +66 -0
- package/dist/core/canonical.js.map +1 -0
- package/dist/core/cbor.d.ts +9 -0
- package/dist/core/cbor.d.ts.map +1 -0
- package/dist/core/cbor.js +213 -0
- package/dist/core/cbor.js.map +1 -0
- package/dist/core/clock.d.ts +18 -0
- package/dist/core/clock.d.ts.map +1 -0
- package/dist/core/clock.js +32 -0
- package/dist/core/clock.js.map +1 -0
- package/dist/core/identity.d.ts +34 -0
- package/dist/core/identity.d.ts.map +1 -0
- package/dist/core/identity.js +62 -0
- package/dist/core/identity.js.map +1 -0
- package/dist/hub/hubClient.d.ts +38 -0
- package/dist/hub/hubClient.d.ts.map +1 -0
- package/dist/hub/hubClient.js +157 -0
- package/dist/hub/hubClient.js.map +1 -0
- package/dist/hub/hubServer.d.ts +28 -0
- package/dist/hub/hubServer.d.ts.map +1 -0
- package/dist/hub/hubServer.js +365 -0
- package/dist/hub/hubServer.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/objects/types.d.ts +352 -0
- package/dist/objects/types.d.ts.map +1 -0
- package/dist/objects/types.js +17 -0
- package/dist/objects/types.js.map +1 -0
- package/dist/observe/logger.d.ts +27 -0
- package/dist/observe/logger.d.ts.map +1 -0
- package/dist/observe/logger.js +37 -0
- package/dist/observe/logger.js.map +1 -0
- package/dist/observe/metrics.d.ts +20 -0
- package/dist/observe/metrics.d.ts.map +1 -0
- package/dist/observe/metrics.js +42 -0
- package/dist/observe/metrics.js.map +1 -0
- package/dist/policy/owners.d.ts +5 -0
- package/dist/policy/owners.d.ts.map +1 -0
- package/dist/policy/owners.js +38 -0
- package/dist/policy/owners.js.map +1 -0
- package/dist/policy/reliability.d.ts +7 -0
- package/dist/policy/reliability.d.ts.map +1 -0
- package/dist/policy/reliability.js +41 -0
- package/dist/policy/reliability.js.map +1 -0
- package/dist/query/diff.d.ts +16 -0
- package/dist/query/diff.d.ts.map +1 -0
- package/dist/query/diff.js +32 -0
- package/dist/query/diff.js.map +1 -0
- package/dist/reducer/incremental.d.ts +2 -0
- package/dist/reducer/incremental.d.ts.map +1 -0
- package/dist/reducer/incremental.js +14 -0
- package/dist/reducer/incremental.js.map +1 -0
- package/dist/reducer/policy.d.ts +17 -0
- package/dist/reducer/policy.d.ts.map +1 -0
- package/dist/reducer/policy.js +143 -0
- package/dist/reducer/policy.js.map +1 -0
- package/dist/reducer/reducer.d.ts +155 -0
- package/dist/reducer/reducer.d.ts.map +1 -0
- package/dist/reducer/reducer.js +849 -0
- package/dist/reducer/reducer.js.map +1 -0
- package/dist/release/sbom.d.ts +7 -0
- package/dist/release/sbom.d.ts.map +1 -0
- package/dist/release/sbom.js +26 -0
- package/dist/release/sbom.js.map +1 -0
- package/dist/semantic/contract.d.ts +32 -0
- package/dist/semantic/contract.d.ts.map +1 -0
- package/dist/semantic/contract.js +150 -0
- package/dist/semantic/contract.js.map +1 -0
- package/dist/semantic/symbols.d.ts +45 -0
- package/dist/semantic/symbols.d.ts.map +1 -0
- package/dist/semantic/symbols.js +323 -0
- package/dist/semantic/symbols.js.map +1 -0
- package/dist/store/applyRedactions.d.ts +16 -0
- package/dist/store/applyRedactions.d.ts.map +1 -0
- package/dist/store/applyRedactions.js +60 -0
- package/dist/store/applyRedactions.js.map +1 -0
- package/dist/store/lock.d.ts +12 -0
- package/dist/store/lock.d.ts.map +1 -0
- package/dist/store/lock.js +63 -0
- package/dist/store/lock.js.map +1 -0
- package/dist/store/objectStore.d.ts +127 -0
- package/dist/store/objectStore.d.ts.map +1 -0
- package/dist/store/objectStore.js +549 -0
- package/dist/store/objectStore.js.map +1 -0
- package/dist/validation/repair.d.ts +31 -0
- package/dist/validation/repair.d.ts.map +1 -0
- package/dist/validation/repair.js +37 -0
- package/dist/validation/repair.js.map +1 -0
- package/dist/validation/runner.d.ts +20 -0
- package/dist/validation/runner.d.ts.map +1 -0
- package/dist/validation/runner.js +90 -0
- package/dist/validation/runner.js.map +1 -0
- package/package.json +83 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 jaebin lee
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# AVCS — Agentic Version Control System
|
|
2
|
+
|
|
3
|
+
*An AI-native version control system for humans and AI agents working concurrently.*
|
|
4
|
+
|
|
5
|
+
[](https://github.com/izagood/avcs/actions/workflows/ci.yml)
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
> Git records **when** the code changed.
|
|
12
|
+
> AVCS records **who changed it, with what intent, on what evidence, and through which conflict decisions** the code reached its current state.
|
|
13
|
+
|
|
14
|
+
AVCS is a new, deliberately Git-incompatible version control system built for a world where humans and **many AI agents edit the same codebase concurrently**. It drops the commit / branch / merge / conflict-marker model and instead stores **intent**, **session**, **operation**, **evidence**, and **decision** as first-class objects. The code tree is not the source of truth — it is a **projection** computed by deterministically *reducing* the operation graph:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
state = reduce(base, operationDAG, decisions, policy, materializer)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The same objects + the same policy + the same materializer produce the same tree on any replica. Merging is not text selection; it is a pure, deterministic reduction.
|
|
21
|
+
|
|
22
|
+
> **Status:** research prototype. The implementation is real and test-covered, but every phase is built to a *working-MVP depth* (file/symbol-level merge, ed25519 signing, heuristic contract analysis). Production-grade tree-sitter integration, multi-signature trust, and hardened distributed sync are tracked on the [roadmap](docs/07-roadmap.md).
|
|
23
|
+
|
|
24
|
+
## Core principles
|
|
25
|
+
|
|
26
|
+
| # | Principle | Contrast with Git |
|
|
27
|
+
|---|-----------|-------------------|
|
|
28
|
+
| 1 | **Operations are history**, not commits | A commit is merely a checkpoint over many operations |
|
|
29
|
+
| 2 | **Identity is the entity ID**, not the file path | Rename + edit can auto-merge |
|
|
30
|
+
| 3 | **Merge is a deterministic reduction**, not text selection | No conflict markers |
|
|
31
|
+
| 4 | **A conflict is a first-class `decision` object**, not a broken file | The rationale stays in history |
|
|
32
|
+
| 5 | **AI output is a proposed operation with attached evidence**, not trusted code | A behavior change with no test cannot be `accepted` |
|
|
33
|
+
| 6 | **Code never defaults to last-write-wins** | Precedence is decided by policy |
|
|
34
|
+
|
|
35
|
+
## How it works
|
|
36
|
+
|
|
37
|
+
Every meaningful thing is a content-addressed, append-only object. Code is a *projection* over the operation DAG, never stored as commits.
|
|
38
|
+
|
|
39
|
+
| Object | Role |
|
|
40
|
+
|--------|------|
|
|
41
|
+
| `intent` | Why a change is being made (goal + constraints + allowed scope) |
|
|
42
|
+
| `session` | An agent/human work episode against an intent |
|
|
43
|
+
| `operation` | A single semantic change unit — the real history |
|
|
44
|
+
| `evidence` | Machine-checkable proof (test / typecheck / lint / scan) attached to operations |
|
|
45
|
+
| `decision` | A recorded resolution of a conflict or design choice |
|
|
46
|
+
| `checkpoint` | A verified (ops + policy + materializer) state vector — replaces a commit |
|
|
47
|
+
| `view` | A declarative query over the operation graph — replaces a branch |
|
|
48
|
+
| `release` | A signed, provenance-bearing checkpoint — replaces a tag |
|
|
49
|
+
| `policy` | The deterministic merge rules the reducer is parameterized by |
|
|
50
|
+
|
|
51
|
+
…plus `blob` for raw content and the governance objects (`lease`, `membership`, `protection`, `promotion`, `redaction`, `override`, `approval`, `line`) used by the multi-machine and security phases.
|
|
52
|
+
|
|
53
|
+
## Conflict resolution levels
|
|
54
|
+
|
|
55
|
+
AVCS never falls back to last-write-wins for code. Contending operations are graded and resolved with a recorded rationale:
|
|
56
|
+
|
|
57
|
+
- **L0 / L1** — different entities, or the same file but different **symbols** → **auto-merge**
|
|
58
|
+
- **L2** — concurrent edits to the same slot → **policy auto-decision** (human-preferred, trust-weighted); the auto-decision is itself recorded in `autoDecisions`
|
|
59
|
+
- **L3** — a behavior change with no *trusted* evidence → **blocked**; an undeclared contract change with live callers → **semantic conflict, auto-escalated**
|
|
60
|
+
- **L4** — a public-API break → **requires a human decision**, routed to the scope's owners
|
|
61
|
+
|
|
62
|
+
Evidence trust matters: an operation's own author cannot vouch for it. Evidence-gating and the passing-test bonus only count evidence produced by a *non-authoring, trusted* actor (CI bot / human).
|
|
63
|
+
|
|
64
|
+
## What works today
|
|
65
|
+
|
|
66
|
+
The reducer and policy engine are the foundation; the higher phases build distributed collaboration, security, and observability on top.
|
|
67
|
+
|
|
68
|
+
**Foundation (Phases 1–6)**
|
|
69
|
+
|
|
70
|
+
- **Storage core** — append-only, content-addressed object store (`.avcs/objects`)
|
|
71
|
+
- **Deterministic reducer + policy engine** — the L0–L4 conflict grading above, with a priority ladder, bounded reliability nudges, and auditable auto-decisions
|
|
72
|
+
- **Symbol-level merge** (Phase 2) — a pluggable `EntityIndexer` (MVP: a TS/JS brace scanner; Tree-sitter backend can drop in) so two edits to different functions in one file auto-merge
|
|
73
|
+
- **Cryptographic trust** (Phase 3) — ed25519-signed evidence/decision; forged signatures fail the trust gate. Real validation runner, `WorkLease`, `RepairContext`
|
|
74
|
+
- **Semantic conflict detection + decision memory** (Phase 4) — signature-drift detection, recallable decisions and learned policies
|
|
75
|
+
- **Policy depth** (Phase 5) — code-owner routing and bounded reliability learning
|
|
76
|
+
- **Release & provenance** (Phase 6) — verified checkpoints + CycloneDX SBOM + signed artifacts
|
|
77
|
+
|
|
78
|
+
**Collaboration, scale & security (Phases 7–12)**
|
|
79
|
+
|
|
80
|
+
- **Phase 7 — multi-machine:** membership/roles (signed key federation), `pull` (object gossip; two replicas converge to the same `treeHash`), protection + `finalize` CAS (non-fast-forward rejected, so a stale push can't overwrite fresh history)
|
|
81
|
+
- **Phase 8 — lineage:** long-lived divergent lines (e.g. v1.x ∥ v2.x, same symbol, different content, zero conflict), `portOp` (backport = cherry-pick)
|
|
82
|
+
- **Phase 9 — scale:** entity index, `materializeAt` (time travel), chunked large-blob storage with dedup
|
|
83
|
+
- **Phase 10 — observability:** `blame` (who/why), `logP`, deterministic `bisect`, `diff`
|
|
84
|
+
- **Phase 11 — external contributions:** quarantine tier + `promote` + untrusted-CI gate
|
|
85
|
+
- **Phase 12 — security:** `redact` (byte-eviction of leaked secrets, oid preserved), break-glass `override`, forward-only rollback
|
|
86
|
+
|
|
87
|
+
Branches become **views**, commits become **checkpoints**, tags become **releases**. Agents drive AVCS through a first-class **MCP server** (21 tools); humans use the **CLI**. The behavior is pinned by a 148-test contract suite (`test/*.test.ts`, all green) and `tsc` is clean.
|
|
88
|
+
|
|
89
|
+
## Install
|
|
90
|
+
|
|
91
|
+
Requires **Node ≥ 22.6** — AVCS runs TypeScript directly via type stripping, so there is **no build step and zero runtime dependencies**.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
curl -fsSL https://raw.githubusercontent.com/izagood/avcs/main/install.sh | bash
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
That one-liner clones the repo to `~/.local/share/avcs` (override with `--dir`/`AVCS_HOME`) and installs an `avcs` launcher to `~/.local/bin`. Re-running it updates the checkout in place. Already have a clone? Run the installer from inside it instead:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
git clone https://github.com/izagood/avcs.git && cd avcs
|
|
101
|
+
./install.sh
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Either way, `install.sh` writes a small `avcs` launcher to `~/.local/bin` (override with `--bin-dir <dir>` or `AVCS_BIN_DIR`) that points back at the checkout, so updating is just `git pull` — no reinstall needed. If `~/.local/bin` isn't on your `PATH` yet, the installer prints the line to add.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
avcs version # confirm it's on your PATH
|
|
108
|
+
avcs help # list every command
|
|
109
|
+
|
|
110
|
+
avcs init . # create a repo in the current directory
|
|
111
|
+
avcs status # operation / conflict summary
|
|
112
|
+
avcs conflicts # decisions a human still owes
|
|
113
|
+
avcs log # operation history
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Other install options:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
./install.sh --bin-dir /usr/local/bin # system-wide (may need sudo)
|
|
120
|
+
./install.sh --name avcs-dev # install under a different command name
|
|
121
|
+
./install.sh --dir ~/src/avcs --ref v1 # one-liner mode: clone dir + ref to install
|
|
122
|
+
./uninstall.sh # remove the launcher (data is left intact)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Prefer npm? `npm link` exposes the same `avcs` binary from `package.json`'s `bin` field. If `node` isn't on your `PATH` at runtime, point the launcher at one with `AVCS_NODE=/path/to/node`.
|
|
126
|
+
|
|
127
|
+
## Use as a library (`@izagood/avcs`)
|
|
128
|
+
|
|
129
|
+
A hosting server (e.g. avcshub) can depend on the AVCS core as a versioned package. Development and tests run the raw `.ts` via type stripping, but `npm publish` ships a `tsc`-compiled `dist/` (JS + type declarations via `tsconfig.build.json`), so consumers import it with no build tooling of their own.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npm install @izagood/avcs
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
import { startHub, type HubHandle } from "@izagood/avcs/hub"; // the hub server
|
|
137
|
+
import { ObjectStore, CorruptObjectError } from "@izagood/avcs/store";
|
|
138
|
+
import { verifyMessage, generateKeypair } from "@izagood/avcs/identity";
|
|
139
|
+
import { Repo } from "@izagood/avcs"; // root: primary public API
|
|
140
|
+
|
|
141
|
+
const hub = await startHub({ repoDir: "./data", port: 8080, gated: true });
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Entry points: `.` (root barrel) · `./hub` · `./hub/client` · `./store` · `./identity` · `./types`.
|
|
145
|
+
|
|
146
|
+
Releasing: bump `package.json`'s `version`, then push a `vX.Y.Z` tag — `.github/workflows/release.yml` runs `npm publish` (with provenance) and cuts a GitHub Release. Requires an `NPM_TOKEN` repository secret with publish rights to the `@izagood` scope.
|
|
147
|
+
|
|
148
|
+
## Quick start
|
|
149
|
+
|
|
150
|
+
If you'd rather not install, every command runs straight from the checkout with `node`:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Walk all four merge scenarios end to end
|
|
154
|
+
node --experimental-strip-types src/demo.ts
|
|
155
|
+
|
|
156
|
+
# Run the behavior-contract test suite
|
|
157
|
+
node --experimental-strip-types --test test/*.test.ts # or: npm test
|
|
158
|
+
|
|
159
|
+
# Human-facing CLI (or just `avcs <command>` once installed)
|
|
160
|
+
node --experimental-strip-types src/cli.ts init .
|
|
161
|
+
node --experimental-strip-types src/cli.ts status
|
|
162
|
+
node --experimental-strip-types src/cli.ts conflicts
|
|
163
|
+
node --experimental-strip-types src/cli.ts log
|
|
164
|
+
|
|
165
|
+
# Agent-facing MCP server (requires the optional dependency)
|
|
166
|
+
npm install
|
|
167
|
+
AVCS_REPO=$(pwd) node --experimental-strip-types src/mcp/server.ts
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
> Type checking (`tsc --noEmit`) needs `npm install`; the runtime itself has no dependencies.
|
|
171
|
+
|
|
172
|
+
## Code map
|
|
173
|
+
|
|
174
|
+
| Path | Role |
|
|
175
|
+
|------|------|
|
|
176
|
+
| `src/objects/types.ts` | Object model definitions (single source of truth) |
|
|
177
|
+
| `src/store/objectStore.ts` | Append-only, content-addressed store |
|
|
178
|
+
| `src/core/canonical.ts` | Canonical serialization + content addressing (oid) |
|
|
179
|
+
| `src/core/identity.ts` | ed25519 sign/verify + Keyring (Phase 3) |
|
|
180
|
+
| `src/reducer/reducer.ts` | Operation graph → code tree reduction + conflict grading |
|
|
181
|
+
| `src/reducer/policy.ts` | Policy engine (priority ladder, reliability nudge) |
|
|
182
|
+
| `src/reducer/incremental.ts` | Incremental re-reduce (reuse clean groups) |
|
|
183
|
+
| `src/semantic/symbols.ts` | Symbol parser (`EntityIndexer`) — symbol-level merge (Phase 2) |
|
|
184
|
+
| `src/semantic/contract.ts` | Signature analysis + semantic conflict detection (Phase 4) |
|
|
185
|
+
| `src/policy/owners.ts`, `reliability.ts` | Code-owner routing · reliability learning (Phase 5) |
|
|
186
|
+
| `src/validation/runner.ts`, `repair.ts` | Validation runner · RepairContext (Phase 3) |
|
|
187
|
+
| `src/concurrency/lease.ts` | WorkLease (Phase 3) |
|
|
188
|
+
| `src/release/sbom.ts` | SBOM generation (Phase 6) |
|
|
189
|
+
| `src/hub/hubServer.ts`, `hubClient.ts` | Multi-machine sync hub (Phase 7) |
|
|
190
|
+
| `src/api/repo.ts` | High-level facade (shared by CLI, demo, MCP) |
|
|
191
|
+
| `src/mcp/server.ts` | Agent-facing MCP interface (21 tools) |
|
|
192
|
+
| `src/cli.ts` | Human-facing inspection/release CLI |
|
|
193
|
+
| `src/demo.ts` | End-to-end scenario |
|
|
194
|
+
|
|
195
|
+
## Design docs
|
|
196
|
+
|
|
197
|
+
- [00 — Overview & principles](docs/00-overview.md)
|
|
198
|
+
- [01 — Architecture](docs/01-architecture.md)
|
|
199
|
+
- [02 — Object model](docs/02-object-model.md)
|
|
200
|
+
- [03 — Reducer & conflict levels](docs/03-reducer.md)
|
|
201
|
+
- [04 — Policy engine](docs/04-policy.md)
|
|
202
|
+
- [05 — Views · Checkpoints · Releases](docs/05-views-checkpoints.md)
|
|
203
|
+
- [06 — MCP / Skill interface](docs/06-mcp-interface.md)
|
|
204
|
+
- [07 — Roadmap](docs/07-roadmap.md)
|
|
205
|
+
- [08 — Governance & consensus (avcshub)](docs/08-governance.md)
|
|
206
|
+
- [09 — Git/GitHub use-case coverage & design evolution](docs/09-usecase-coverage.md)
|
|
207
|
+
- [10 — Production design plan](docs/10-production-plan.md)
|
|
208
|
+
- [11 — Incremental reduce](docs/11-incremental-reduce.md)
|
|
209
|
+
- [12 — Local production](docs/12-local-production.md)
|
|
210
|
+
- [13 — Hub production](docs/13-hub-production.md)
|
|
211
|
+
- [14 — Git bridge (real-world compatibility)](docs/14-git-bridge.md)
|
|
212
|
+
|
|
213
|
+
## Contributing
|
|
214
|
+
|
|
215
|
+
This is an early-stage research prototype and the design is still moving. Issues and discussion are welcome — if you're proposing a change, the design docs above are the best starting point for the rationale behind the current model. Please run `npm test` and `npm run typecheck` before opening a pull request.
|
|
216
|
+
|
|
217
|
+
Every push and pull request to `main` runs CI ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)): `npm ci` → `npm run typecheck` → `npm test` on Node 22.x and 24.x. PRs are merged only when CI is green.
|
|
218
|
+
|
|
219
|
+
## License
|
|
220
|
+
|
|
221
|
+
Licensed under the [Apache License 2.0](LICENSE). Copyright © 2026 jaebin lee. See [NOTICE](NOTICE) for attribution.
|