opencode-azure-devops-pr-review 0.3.1 → 0.3.3

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +128 -86
  3. package/package.json +2 -11
  4. package/src/attribution.mjs +2 -4
  5. package/src/azure.mjs +5 -2
  6. package/src/host.mjs +28 -5
  7. package/src/runtime.mjs +13 -7
  8. package/src/session.mjs +6 -12
  9. package/AGENTS.md +0 -164
  10. package/CODE_OF_CONDUCT.md +0 -83
  11. package/CONTRIBUTING.md +0 -84
  12. package/SECURITY.md +0 -38
  13. package/config/settings.example.json +0 -55
  14. package/config/settings.schema.json +0 -316
  15. package/docs/ARCHITECTURE.md +0 -414
  16. package/docs/AZURE_DEVOPS.md +0 -217
  17. package/docs/COMMENTING.md +0 -399
  18. package/docs/DEBUGGING.md +0 -146
  19. package/docs/DEMO.md +0 -195
  20. package/docs/ENTERPRISE.md +0 -236
  21. package/docs/QUICKSTART.md +0 -238
  22. package/docs/RELEASING.md +0 -95
  23. package/docs/ROADMAP.md +0 -241
  24. package/docs/VALIDATION.md +0 -2127
  25. package/docs/VALIDATION_HISTORY.md +0 -1845
  26. package/docs/VERIFICATION.md +0 -42
  27. package/docs/assets/RECORDING.md +0 -131
  28. package/docs/assets/adjust-findings-teaser.gif +0 -0
  29. package/docs/assets/adjust-preview.png +0 -0
  30. package/docs/assets/adjust-publication.png +0 -0
  31. package/docs/assets/example-comments.md +0 -38
  32. package/docs/assets/generate-demo-gif.py +0 -25
  33. package/docs/assets/generate-demo.mjs +0 -141
  34. package/docs/assets/live-azure-readback.png +0 -0
  35. package/docs/assets/live-preview.png +0 -0
  36. package/docs/assets/live-review-teaser.gif +0 -0
  37. package/docs/assets/live-review.png +0 -0
  38. package/docs/assets/quick-review-demo.gif +0 -0
  39. package/docs/assets/record-terminal.py +0 -124
  40. package/docs/assets/render-terminal-demo.py +0 -168
  41. package/docs/assets/review-example.svg +0 -1
  42. package/docs/assets/walkthrough.svg +0 -1
  43. package/docs/releases/v0.1.0.md +0 -74
  44. package/docs/releases/v0.2.0.md +0 -107
  45. package/docs/releases/v0.2.1.md +0 -65
  46. package/docs/releases/v0.2.2.md +0 -76
  47. package/docs/releases/v0.2.3.md +0 -93
  48. package/docs/releases/v0.3.0.md +0 -125
  49. package/docs/releases/v0.3.1.md +0 -87
  50. package/install.sh +0 -171
  51. package/scripts/merge-settings.py +0 -120
  52. package/uninstall.sh +0 -50
package/src/runtime.mjs CHANGED
@@ -27,7 +27,7 @@ import { API_VERSION, createAzureClient, fetchTransport, pemCertificates, proxyL
27
27
  import { REVIEW_TOOL_NAMES, reviewToolDefinitions, runReviewTool } from './review-tools.mjs';
28
28
  import { runReview } from './review-work.mjs';
29
29
  import { createReviewStore, stateRoot, REVIEW_LIMIT } from './store.mjs';
30
- import { TESTED_HOST_VERSION, fetchTransportSupported, hostCapabilities, listOf, packageNamed, pluginEntries, pluginSourceLabel, recordOf, requireMethods, sessionProgress, tokenUsage, usageTotals, withoutCredentials } from './host.mjs';
30
+ import { PROGRESS_EVENT_TYPES, TESTED_HOST_VERSION, USED_UP_LIMITS, fetchTransportSupported, hostCapabilities, listOf, packageNamed, pluginEntries, pluginSourceLabel, recordOf, requireMethods, sessionProgress, tokenUsage, usageTotals, withoutCredentials } from './host.mjs';
31
31
  import {
32
32
  reviewProvenance, provenanceReport, commentAttribution, renderFinalReport, renderCommentActions,
33
33
  renderIncompleteDraft, renderReceipt, renderDiagnosticNotices, renderCheckReport, renderPublication,
@@ -412,7 +412,7 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
412
412
  eventFollowers++;
413
413
  if (eventFeed || disposed || !capabilities.eventSubscribe) return;
414
414
  let iterator;
415
- try { iterator = context.event.subscribe()[Symbol.asyncIterator](); } catch { return; }
415
+ try { iterator = context.event.subscribe({ types: [...PROGRESS_EVENT_TYPES] })[Symbol.asyncIterator](); } catch { return; }
416
416
  eventFeed = iterator;
417
417
  void (async () => {
418
418
  try {
@@ -681,7 +681,7 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
681
681
  }
682
682
  requireMethods(context, ['session.create', 'session.prompt', 'session.wait', 'session.context', 'session.interrupt', 'session.synthetic'], 'the review workflow');
683
683
  let id; do { id = randomUUID().slice(0, 8); } while (runs.has(id) || completed.has(id));
684
- const run = { ...details, id, active: true, controller: new AbortController(), stages: [], toolText: new Map(), compatibility: capabilities,
684
+ const run = { ...details, id, active: true, controller: new AbortController(), stages: [], toolText: new Map(),
685
685
  deadlineAt: settings.runTimeoutSeconds === null ? null : Date.now() + settings.runTimeoutSeconds * 1000 };
686
686
  runs.set(id, run);
687
687
  sourceRuns.set(run.origin, id);
@@ -765,6 +765,10 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
765
765
  else if (modelSlots('deep').every(slot => settings.models.deep[slot] === settings.models.review[slot])) {
766
766
  checks.push({ name: 'Deep models', ok: true, warning: true, detail: 'models.deep repeats models.review, so /pr-deep would only repeat /pr-review; set stronger models there for the PRs that need them.' });
767
767
  }
768
+ // One OpenCode release is validated; on others, reviews still run and what AZPR needs is detected at runtime.
769
+ const host = capabilities.version === 'unknown' ? 'OpenCode did not report its version' : `OpenCode ${capabilities.version}`;
770
+ checks.push(capabilities.tested ? { name: 'OpenCode', ok: true, detail: `${host}, the tested version.` }
771
+ : { name: 'OpenCode', ok: true, warning: true, detail: `${host}; AZPR is tested with ${TESTED_HOST_VERSION}. Reviews still run: AZPR detects what this OpenCode provides and refuses to start if something it needs is missing.` });
768
772
  checks.push(await installationCheck(run));
769
773
  // What follows a COMPLETE review of each mode; automatic publication posts as the PAT owner.
770
774
  const publishing = MODES.filter(mode => settings.afterReview[mode] === 'publish').map(mode => `/pr-${mode}`);
@@ -1223,7 +1227,7 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
1223
1227
  try {
1224
1228
  const g = authorize(event.sessionID, event.agent, event.model);
1225
1229
  // Refused before anything is sent. Whether the stage overflowed is read from its failed turn: a
1226
- // compaction OpenCode attempts there ends it, a background summary (OpenCode 2.1.4) does not.
1230
+ // compaction OpenCode attempts there ends it, a background summary (OpenCode 2.1.4 and later) does not.
1227
1231
  if (event.kind !== 'primary') {
1228
1232
  throw new Error(event.kind === 'compaction'
1229
1233
  ? '[AZPR] Private review compaction is not authorized; a reviewer whose context fills is split into smaller sessions instead.'
@@ -1243,12 +1247,14 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
1243
1247
  if (!ownRole(event.agent) && !seenSessions.has(event.sessionID)) return;
1244
1248
  const g = grants.get(event.sessionID);
1245
1249
  const proposed = event.decision?.retry === true;
1250
+ // A used-up usage or spend limit fails every attempt the same way; the failed turn names it.
1251
+ const usedUp = Object.hasOwn(USED_UP_LIMITS, event.error?.type) ? event.error.type : null;
1246
1252
  let authorized = false;
1247
- try { if (g?.run.active) { authorize(event.sessionID, event.agent, event.model); authorized = true; } } catch { /* Revoked. */ }
1253
+ try { if (g?.run.active && !usedUp) { authorize(event.sessionID, event.agent, event.model); authorized = true; } } catch { /* Revoked. */ }
1248
1254
  if (!authorized) event.decision = { retry: false };
1249
1255
  const attempt = Number.isInteger(event.attempt) ? event.attempt : null;
1250
1256
  const delayMs = Number.isFinite(event.decision?.delay) && event.decision.delay > 0 ? event.decision.delay : 0;
1251
- g?.retryEvents.push({ attempt, proposed, allowed: authorized && proposed, ...(delayMs ? { delayMs } : {}) });
1257
+ g?.retryEvents.push({ attempt, proposed, allowed: authorized && proposed, ...(usedUp ? { usedUp } : {}), ...(delayMs ? { delayMs } : {}) });
1252
1258
  // OpenCode waits before it prepares the request again; that wait is not inactivity.
1253
1259
  if (authorized && proposed) touch(g, `the host scheduled a retry${attempt === null ? '' : ` (attempt ${attempt})`}`, delayMs);
1254
1260
  }));
@@ -1256,7 +1262,7 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
1256
1262
  // Enforce the shell setting and the project boundary, regardless of
1257
1263
  // permission rules the host appends after this plugin. Outside the
1258
1264
  // project only AZPR's own private data is readable; the host's default
1259
- // for other paths is not trusted (OpenCode 2.0.22 asked; 2.0.31 through 2.1.4 allow).
1265
+ // for other paths is not trusted (OpenCode 2.0.22 asked; 2.0.31 through 2.2.4 allow).
1260
1266
  // Private reviewers run unattended: a request that would wait for
1261
1267
  // approval is refused at once. Only shell keeps host approvals, and only
1262
1268
  // when the user allowed it (shell: "ask" or "inherit").
package/src/session.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /** OpenCode V2 session transport. No provider, Azure or HTTP client. */
2
2
  import { isDeepStrictEqual } from 'node:util';
3
- import { FOREIGN_MESSAGE_TYPES, isHostContinuation, requireMethods } from './host.mjs';
3
+ import { FOREIGN_MESSAGE_TYPES, USED_UP_LIMITS, isHostContinuation, requireMethods } from './host.mjs';
4
4
 
5
5
  const pendingAdmissions = new WeakMap();
6
6
  const textValue = value => typeof value === 'string' && value.length > 0;
@@ -104,16 +104,10 @@ function responseError(message, response, execution) {
104
104
  }
105
105
 
106
106
  // Bounded host metadata only; provider bodies can contain private request data.
107
- // Provider errors that a new session cannot fix: the usage limit is used up.
108
- const EXHAUSTED = {
109
- 'provider.quota': 'The provider reports the usage quota as used up',
110
- 'provider.free-limit': "OpenCode reports the free model's usage limit as reached",
111
- };
112
-
113
107
  function providerFailure(final, assistants) {
114
108
  const error = final?.error;
115
109
  if (typeof error?.type !== 'string' || !error.type.startsWith('provider.')) return undefined;
116
- const exhausted = Object.hasOwn(EXHAUSTED, error.type);
110
+ const exhausted = Object.hasOwn(USED_UP_LIMITS, error.type);
117
111
  const status = Number.isInteger(error.status) && error.status >= 400 && error.status <= 599 ? error.status : undefined;
118
112
  if (status === undefined && !exhausted) return undefined;
119
113
  return { ...(status === undefined ? {} : { status }), ...(exhausted ? { exhausted: error.type } : {}),
@@ -171,8 +165,8 @@ export function restartIndex(texts) {
171
165
  * its own failure decides.
172
166
  * - transient: interrupted streams, provider 408/409/425/429/5xx, missing idle,
173
167
  * unexpected host messages.
174
- * - permanent: everything else (authentication, bad request, a used-up quota or
175
- * free-model limit, whatever its HTTP status, cancellation).
168
+ * - permanent: everything else (authentication, bad request, a used-up usage or
169
+ * spend limit, whatever its HTTP status, cancellation).
176
170
  */
177
171
  export function classifyFailure(error) {
178
172
  const execution = error?.execution;
@@ -235,13 +229,13 @@ export async function requestReview(context, { sessionID, text, role, model, met
235
229
  assistantResponses: assistants.length, lastFinish: finish,
236
230
  interrupted: session.outcome === 'interrupted' || terminal?.outcome === 'interrupted' || final?.error?.type === 'aborted' };
237
231
  // OpenCode opens a compaction's message before it asks for the summary, so a compaction it attempted in this
238
- // turn, which AZPR refuses, shows here. A background summary (OpenCode 2.1.4) publishes nothing.
232
+ // turn, which AZPR refuses, shows here. A background summary (OpenCode 2.1.4 and later) publishes nothing.
239
233
  const compaction = turn.filter(message => message?.type === 'compaction').at(-1);
240
234
  if (compaction) execution.compaction = ['running', 'completed', 'failed'].includes(compaction.status) ? compaction.status : 'unknown';
241
235
  const provider = !execution.interrupted && providerFailure(final, assistants);
242
236
  if (provider) execution.provider = provider;
243
237
  const hint = provider?.exhausted
244
- ? ` ${EXHAUSTED[provider.exhausted]} (${provider.exhausted}), so a new session would fail the same way and is not started. Choose another model in the settings or wait until the limit resets.`
238
+ ? ` ${USED_UP_LIMITS[provider.exhausted]} (${provider.exhausted}), so a new session would fail the same way and is not started. Choose another model in the settings or wait until the limit resets.`
245
239
  : [401, 403].includes(provider?.status) ? ' Check provider access and the role\'s tool permissions.' : '';
246
240
  const detail = provider
247
241
  ? `Model provider request failed (${provider.status ? `HTTP ${provider.status}; ` : ''}${provider.toolCallsObserved} tool calls observed).${hint} `
package/AGENTS.md DELETED
@@ -1,164 +0,0 @@
1
- # AI development guide
2
-
3
- This repository targets the OpenCode V2 plugin API (tested with
4
- `@opencode/cli@2.1.4`), the Azure DevOps Services REST API (api-version 7.1)
5
- and Ubuntu 22.04. Public source and documentation use English. Follow the user's
6
- conversation language and current authorization scope.
7
-
8
- ## Before changing anything
9
-
10
- Confirm the Git root, branch, HEAD, working tree and installed paths. Read
11
- README, architecture, roadmap and the task-relevant docs. Local handover notes
12
- under `.local/` (their file name differs between checkouts) give background
13
- and hand-off state, never new authorization; check what they say against Git
14
- and the actual environment. Preserve unrelated changes, credentials, private
15
- settings, backups and failure records. Never upload `.local/`.
16
-
17
- ## Design rules
18
-
19
- **Deterministic facts are code; judgment is model work.**
20
- - PR identity, commit SHAs, the changed-file list, version rechecks, existing
21
- threads and all Azure DevOps writes go through `azure.mjs`, which calls the
22
- REST API with `azure.organization` and the PAT from AZPR's settings
23
- (`azure.pat`, or the owner-only file named by `azure.patFile`, which is read
24
- only through its symbolic-link, owner and mode checks). Keep
25
- REST paths and the pinned api-version in `azure.mjs` only; never log, echo or
26
- persist the PAT, and send it only to the organization's REST endpoint.
27
- `azure.proxy`, `azure.caFile` and `azure.verifyTls` shape only that
28
- connection; never show proxy credentials.
29
- - Models read the repository only through the read-only tools in
30
- `review-tools.mjs`, registered with `codemode: false`; private roles see an
31
- explicit tool allowlist and ordinary sessions never see AZPR's tools.
32
- - Models review, verify and plan comment text. They never echo identity or SHAs
33
- and never write to Azure DevOps.
34
-
35
- **Quick reviews are not verified, and say so.**
36
- - `/pr-quick` runs one reviewer per shard and no verifier or duplicate check.
37
- The runtime checks only the form and source of its findings (fields, a
38
- location that exists at that commit, a file this session's own tools read);
39
- it never judges whether a defect is real. Passing findings are `REPORTED`,
40
- the rest `NEEDS_INFO`, and the review records `verification: "none"`.
41
- - Never present quick findings as verified: shared prompts carry
42
- `<!-- azpr:verified -->` / `<!-- azpr:quick -->` variants for the passages
43
- about where findings come from, the report and receipt state status,
44
- coverage and verification separately, and the comment disclosure line names
45
- the quick method. The review system prompts, which deep shares, stay
46
- byte-identical unless a change to them is deliberate (a hash test locks them).
47
- - Only records identical in every field are merged as duplicates; findings on
48
- the same lines stay separate. A parsed answer without a usable review never
49
- makes a commentable COMPLETE, and zero findings never hide unreviewed files.
50
-
51
- **Deep reviews differ only in their models.**
52
- - `/pr-deep` runs the review's stages and system prompts with the models of
53
- `models.deep`, which are meant to be stronger than the review models, and
54
- never falls back to the review models. Deep-only prompt text was removed
55
- after live runs showed it changed neither model's results; add
56
- mode-specific instructions only with a measured benefit.
57
-
58
- **Keep useful work; degrade per item.**
59
- - Answers that break the output contract get a correction turn in the same
60
- session (`workflow.repairAttempts`) listing concrete problems. After that,
61
- degrade the affected item (UNREVIEWED, NEEDS_INFO, skipped comment) and keep the
62
- rest. Never discard a whole review for one bad item, and never invent a
63
- decision, evidence or a location.
64
- - A quick reviewer whose usable answer is PARTIAL with named unfinished work
65
- gets one follow-up turn in the same session, within the same budget; a
66
- follow-up that fails or gives no usable answer never replaces the answer it
67
- followed.
68
- - Transient execution failures retry once in a new session; overflow splits the
69
- shard. Permanent failures and cancellations are not retried.
70
- - Only a changed source commit makes a review STALE.
71
-
72
- **Bounded, recoverable execution.**
73
- - All AZPR Azure DevOps traffic shares the queue in `tool-queue.mjs` (concurrency and
74
- per-call timeout). Release slots in `finally`; never depend on a hook running.
75
- - Large PRs are handled by sharding, not by compaction: private sessions may not
76
- compact, and a compaction the host attempts in a reviewer's turn means "split
77
- this shard". A refused background summary (`experimental.background_compaction`)
78
- ends nothing, so the turn's own failure decides its class.
79
- - There is deliberately no default whole-run timeout and no per-stage step cap;
80
- see the roadmap's Deferred section before adding either.
81
-
82
- **Authorization.**
83
- - Only explicit commands start private sessions, and the comment step a
84
- COMPLETE review hands on when `afterReview` or the review command's flag
85
- (`--preview`, `--publish`) asks for it; that step is a run of its own with a
86
- STARTED notice and a receipt. Every private prompt is the
87
- exact runtime-pending text with a fresh nonce; private agents cannot be
88
- mentioned, delegated, compacted or used for auxiliary requests.
89
- - Settings are read once; a changed file blocks new runs only. Hooks check the
90
- grant, not files or catalogs.
91
- - Pin private agent definitions at first use and refuse later host changes.
92
- - Shell for private roles follows the `shell` setting (default deny), enforced
93
- through the `permission` hook and by hiding the tool. Native edit, write,
94
- patch, delegation, web, question, session/model control and CodeMode execute
95
- stay denied. Allowed shell has real host authority; never call it a sandbox.
96
- - `/pr-comment` and `/pr-stop` act only within the caller's conversation (or a
97
- session of that review).
98
-
99
- **Publication is idempotent.**
100
- - Recheck the PR (active, unchanged head) before writing; skip existing markers;
101
- save each result immediately; read markers back. Re-running is always safe.
102
- - Automatic publication (`afterReview: publish` or `--publish` after the PR
103
- URL) follows only a COMPLETE review with findings to comment on that nothing
104
- stopped. It posts item by item: an item whose text has an `@<…>` mention,
105
- an image, HTML that embeds content, runs a script or hides text, or a `javascript:`,
106
- `vbscript:`, `data:` or `file://` link (mentions and script links also after
107
- decoding escapes and character references, script links also without tabs
108
- and line breaks) waits for a person, and the
109
- receipt names it; ordinary links are posted, and literal code is skipped
110
- (except for mentions) only where every reading of the Markdown agrees. A
111
- plan that would post only a
112
- repeated summary (every finding skipped as already discussed on the PR) is
113
- `NOTHING_TO_POST`. Its checks are deterministic and prefer a false alarm;
114
- never relax them to model judgment. Commands the user types keep their
115
- behavior.
116
- - Inline markers are stable (PR, path, normalized anchor, ordinal); do not put a
117
- review ID or model wording into them.
118
- - A person's adjustments (`/pr-comment <review-id> --exclude`, `--severity`,
119
- `--reset`) change only the findings handed to comment planning, never the
120
- review record or a prompt file; the planner input carries `adjustments` only
121
- when some exist, so unadjusted reviews plan exactly as before. A review
122
- adjusted once is posted only from a preview planned after its latest
123
- adjustment (an adjustment drops the earlier preview in the same save) and is
124
- neither adjusted nor planned again once its publication started. That save
125
- and the new preview's save must succeed; never let a failed save report an
126
- adjustment as applied. Text the runtime renders that names an excluded
127
- finding holds publication. Items an earlier publication already put on the
128
- PR are skipped as always; its receipt names those whose text differs, since
129
- posted comments are never changed.
130
- - Comment planning pages run side by side, so nothing a page sees or produces
131
- may depend on which page finishes first: only the first page writes the
132
- summary note, each page keeps its own continuation state and evidence, and
133
- pages are assembled in page order (ordinals follow page order).
134
-
135
- **Persistence and privacy.**
136
- - Completed reviews, plans and ledgers persist under the private state directory
137
- (owner-only permissions, newest 20). Clean only stale, unreferenced data.
138
- - Diagnostics are opt-in and never record reasoning, headers or provider
139
- configuration.
140
-
141
- **Compatibility.** Host response shapes and constants belong in `host.mjs`.
142
- Detect capabilities; do not assume them.
143
-
144
- ## Verification and delivery
145
-
146
- Run `npm run check` and `npm test`. For changes touching hooks, sessions, tools, Azure access or
147
- publication, also run `node tests/host-v2-smoke.mjs <opencode binary>` (fresh and
148
- `--replace`), `node tests/host-v2-comment-scale.mjs <opencode binary>` and
149
- `node tests/host-v2-background-compaction.mjs <opencode binary>`.
150
- For package entry points, first-run setup or settings-path changes, also run
151
- `node tests/host-v2-smoke.mjs <opencode binary> --native`; this installs the
152
- packed artifact through OpenCode's plugin manager in an isolated profile.
153
- Installer tests must preserve unrelated files and private settings, reject
154
- conflicts and test rollback and archival uninstall. Keep the README manual-copy
155
- list exact.
156
-
157
- Fake-service fixtures and live Azure/model runs establish different claims;
158
- record exact versions, environment and limitations in `docs/VALIDATION.md`, and
159
- move superseded validation pages to `docs/VALIDATION_HISTORY.md` instead of
160
- rewriting earlier results.
161
-
162
- Do not start live models, publish PR comments, change personal settings,
163
- upgrade installed tools or publish a repository or package without authorization
164
- for that action. Authorization applies to the current request only.
@@ -1,83 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or advances of any kind
22
- * Trolling, insulting or derogatory comments, and personal or political attacks
23
- * Public or private harassment
24
- * Publishing others' private information, such as a physical or email address, without their explicit permission
25
- * Other conduct which could reasonably be considered inappropriate in a professional setting
26
-
27
- ## Enforcement Responsibilities
28
-
29
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
-
31
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
-
33
- ## Scope
34
-
35
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
-
37
- ## Enforcement
38
-
39
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at weiting.lai.code@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
40
-
41
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42
-
43
- ## Enforcement Guidelines
44
-
45
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46
-
47
- ### 1. Correction
48
-
49
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50
-
51
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52
-
53
- ### 2. Warning
54
-
55
- **Community Impact**: A violation through a single incident or series of actions.
56
-
57
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58
-
59
- ### 3. Temporary Ban
60
-
61
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62
-
63
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64
-
65
- ### 4. Permanent Ban
66
-
67
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68
-
69
- **Consequence**: A permanent ban from any sort of public interaction within the community.
70
-
71
- ## Attribution
72
-
73
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74
-
75
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76
-
77
- For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
78
-
79
- [homepage]: https://www.contributor-covenant.org
80
- [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
81
- [Mozilla CoC]: https://github.com/mozilla/diversity
82
- [FAQ]: https://www.contributor-covenant.org/faq
83
- [translations]: https://www.contributor-covenant.org/translations
package/CONTRIBUTING.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributing
2
-
3
- Bug reports, focused fixes and documentation improvements are welcome. Start
4
- with the [quickstart](docs/QUICKSTART.md), [architecture](docs/ARCHITECTURE.md)
5
- and [roadmap](docs/ROADMAP.md). Public source and documentation use English.
6
- Everyone taking part follows the [code of conduct](CODE_OF_CONDUCT.md), which
7
- also says where to report a conduct problem.
8
-
9
- ## Report a problem or suggest a change
10
-
11
- Use the [issue forms](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/issues/new/choose).
12
- Include the AZPR tag or commit, OpenCode version, operating system, command and
13
- a small reproduction. For a review failure, the sanitized error and relevant
14
- receipt stage are usually enough to start. Describe the PR's approximate file
15
- and changed-line counts if its size matters. You do not need to share a company
16
- repository or run a paid review again to file a report.
17
-
18
- Issues are public. Never attach raw settings, PATs, provider credentials,
19
- proxy URLs containing credentials, `.local/`, state directories or complete
20
- diagnostics. Receipts and screenshots can also contain private organization,
21
- repository and source details; inspect and redact excerpts before sharing.
22
- See [debugging](docs/DEBUGGING.md) and [data handling](docs/ENTERPRISE.md).
23
- Report suspected security vulnerabilities through [private reporting](SECURITY.md).
24
-
25
- For a larger feature, describe the use case and proposed behavior in an issue
26
- before investing in an implementation. A documentation fix or small bug fix
27
- can go straight to a pull request.
28
-
29
- ## Work locally
30
-
31
- Use Node.js 22.12 or later, POSIX `sh`, Python 3 and Git. The current host
32
- acceptance target is OpenCode V2 `@opencode/cli@2.1.4` on Ubuntu 22.04; other
33
- environments are not yet validated. The runtime has no npm dependencies or
34
- build step. From your checkout:
35
-
36
- ```sh
37
- npm run check
38
- npm test
39
- ```
40
-
41
- Read [AGENTS.md](AGENTS.md) for the design rules and change-specific checks.
42
- Keep deterministic PR facts and Azure writes in the runtime; models supply
43
- review judgment and comment text. Preserve the distinction between quick
44
- findings and independently verified findings. Add a focused regression test
45
- when fixing behavior, and update the relevant documentation when it changes.
46
-
47
- Changes to hooks, sessions, tools, Azure access or publication also need all
48
- five host fixture runs. Install the tested host into a disposable local directory
49
- without changing your everyday OpenCode installation:
50
-
51
- ```sh
52
- npm install --prefix "$PWD/.local/contributor-host" --no-audit --no-fund @opencode/cli@2.1.4
53
- AZPR_TEST_HOST="$PWD/.local/contributor-host/node_modules/.bin/opencode"
54
- node tests/host-v2-smoke.mjs "$AZPR_TEST_HOST"
55
- node tests/host-v2-smoke.mjs "$AZPR_TEST_HOST" --replace
56
- node tests/host-v2-smoke.mjs "$AZPR_TEST_HOST" --native
57
- node tests/host-v2-comment-scale.mjs "$AZPR_TEST_HOST"
58
- node tests/host-v2-background-compaction.mjs "$AZPR_TEST_HOST"
59
- ```
60
-
61
- The fixtures need `openssl` and use isolated configuration, a fake model
62
- provider and fake Azure services. They do not need your PAT or provider account,
63
- consume paid model quota, or post real comments. Their records stay under the
64
- ignored `.local/` directory. Passing them establishes host integration, not
65
- real-model review quality or live Azure acceptance.
66
-
67
- Installer changes must preserve unrelated files and private settings, reject
68
- conflicts, and cover rollback and archival uninstall. Keep the README's
69
- manual-copy file list accurate. Never replace your personal configuration or
70
- run live models or Azure publication as an incidental test; use a designated
71
- test environment with explicit permission for those actions.
72
-
73
- ## Open a pull request
74
-
75
- Keep the change focused. Explain the problem, resulting behavior and checks
76
- run; name anything you could not verify. A short title such as
77
- `fix: preserve comment recovery after restart` is useful, but no special commit
78
- format is required. Do not include generated private records or credentials.
79
-
80
- For host compatibility or live acceptance evidence, record exact versions,
81
- environment and limitations in [current validation](docs/VALIDATION.md), and
82
- preserve superseded results in [validation history](docs/VALIDATION_HISTORY.md).
83
- Keep fake-service and live results distinct. Documentation-only changes need
84
- link and example checks; they do not require live reviews or publication.
package/SECURITY.md DELETED
@@ -1,38 +0,0 @@
1
- # Security policy
2
-
3
- ## Report a vulnerability privately
4
-
5
- Use GitHub's [private vulnerability reporting](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/security/advisories/new)
6
- for suspected credential exposure, unauthorized model or Azure requests,
7
- private-session permission bypasses, or other security defects. Do not open a
8
- public issue or pull request containing an exploit or sensitive evidence.
9
-
10
- Include:
11
-
12
- - The affected AZPR tag or commit, OpenCode version and operating system.
13
- - The affected component, expected boundary and observed impact.
14
- - Minimal reproduction steps using synthetic source and dummy credentials,
15
- where possible.
16
- - A proposed fix or mitigation, if you have one.
17
-
18
- Even a private report should not contain live PATs, provider tokens, complete
19
- settings, company source or raw diagnostic archives. Share the smallest
20
- redacted excerpt that demonstrates the problem. If a credential was exposed,
21
- revoke or rotate it through its issuer rather than sharing it for reproduction.
22
-
23
- The [validation record](docs/VALIDATION.md) identifies the currently tested
24
- host and environment. Include reports from other versions too, with their
25
- exact versions so the affected behavior can be reproduced.
26
-
27
- ## Understand the boundaries
28
-
29
- AZPR runs inside OpenCode with your account's authority. Allowed shell commands
30
- are not sandboxed. Review source and discussion text can reach the configured
31
- model providers, and local review records can contain that source. See
32
- [team setup and data handling](docs/ENTERPRISE.md) and
33
- [authorization and isolation](docs/ARCHITECTURE.md#authorization-and-isolation)
34
- for the intended boundaries and defaults.
35
-
36
- For ordinary failures or incorrect findings without a security impact, use the
37
- [public bug form](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/issues/new?template=bug_report.yml)
38
- with sanitized evidence.
@@ -1,55 +0,0 @@
1
- {
2
- "$schema": "./settings.schema.json",
3
- "version": 2,
4
- "models": {
5
- "review": {
6
- "functional": "REPLACE_PROVIDER/REPLACE_FUNCTIONAL",
7
- "risk": "REPLACE_PROVIDER/REPLACE_RISK",
8
- "verifier": "REPLACE_PROVIDER/REPLACE_VERIFIER"
9
- },
10
- "deep": {
11
- "functional": "",
12
- "risk": "",
13
- "verifier": ""
14
- },
15
- "quick": {
16
- "reviewer": ""
17
- }
18
- },
19
- "enabled": true,
20
- "returnReport": "receipt",
21
- "debug": {
22
- "enabled": false,
23
- "directory": "",
24
- "keepRuns": 20
25
- },
26
- "outputLanguage": "en",
27
- "runTimeoutSeconds": null,
28
- "shell": "deny",
29
- "progressNotices": true,
30
- "deletePrivateSessions": true,
31
- "afterReview": {
32
- "quick": "none",
33
- "review": "none",
34
- "deep": "none"
35
- },
36
- "azure": {
37
- "organization": "",
38
- "pat": "",
39
- "patFile": "",
40
- "concurrency": 3,
41
- "callTimeoutSeconds": 120,
42
- "archiveMegabytes": 100,
43
- "proxy": "",
44
- "caFile": "",
45
- "verifyTls": true
46
- },
47
- "workflow": {
48
- "shardFiles": 25,
49
- "shardFindings": 15,
50
- "parallelSessions": 4,
51
- "repairAttempts": 2,
52
- "stageRetries": 1,
53
- "stageIdleSeconds": 600
54
- }
55
- }