Skip to content
Merged
13 changes: 12 additions & 1 deletion docs/plans/project-install-e2e/client-plans.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,17 @@ malformed/commented settings, conflicting user server and trust gating. A
settings-file receipt proves configuration, not initialized MCP/tools or
authentication. No extension install/global profile redirection is needed.

**Implemented checkpoint (2026-10-23).** `65b8f17a` qualifies the native
project component lane with independent implementation
[R1](gemini-code-review-r1.md) and [R2](gemini-code-review-r2.md) GO. Project
configuration success remains prepared with installed exact objects. Native
session discovery, workspace trust, system policy and MCP initialization remain
unobserved; activation attestation cannot upgrade that status. Bounded
user/workspace restriction and alias warnings preserve policy and foreign
files. [Pinned evidence and verification](gemini-implementation-evidence.md)
separate actual version/help research, production composition contracts and
remaining hosted native runtime qualification.

## 5. OpenCode — project config at repository root

**Evidence/choice.** Native project MCP uses `<project>/opencode.json` or
Expand Down Expand Up @@ -590,7 +601,7 @@ is replaced by explicit unsupported. R2 fixes independently verified GO in
| claude | GO | Verified | GO | Root assignment required |
| codex | GO | Verified | GO | Root assignment required |
| cursor | GO | Verified | GO | Root assignment required |
| gemini | GO | Verified | GO | Root assignment required |
| gemini | GO | Verified | GO | Implemented at65b8f17a; independent implementation R1/R2 GO; native discovery pending |
| opencode | GO | Verified | GO | Root assignment required |
| copilot | GO | Verified | GO | Root assignment required |
| kiro | GO | Verified | GO | Root assignment required |
Expand Down
37 changes: 37 additions & 0 deletions docs/plans/project-install-e2e/gemini-code-review-r1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Gemini project implementation independent review R1

Reviewer: project_core, 2026-10-23. Initial read-only checkpoint `d76f29ae..a96b4aff07dedfb99297d3fab564b1c778d6968b` in the Gemini child worktree. Review scope is the Gemini adapter and the owner-authorized precise CodecGemini comment parsing delta. Shared core was reviewed separately.

## Decision

**R1 GO at final frozen `65b8f17a951e80f06f9ed9c2677dd16a3ccd3d0a`.** Scoped root selection, conservative project readiness, exact native ownership and the precise Gemini comment codec changes have no confirmed blocker. Initial checkpoint observations below are retained as review history. Native Gemini session discovery and cohesive source/project CLI execution remain separate qualification/integration gates.

## Initial checkpoint assessment

**No confirmed blocker in the scoped native paths or codec delta. Final GO is pending the author's catalog qualification, conservative project readiness, disabled/shadowed settings, alias/preflight and composed stager tests.** The initial checkpoint alone is not yet project admission/product proof.

- Project native settings/skills root is explicitly `<TargetContext.ProjectRoot>/.gemini`. Detected `Client.ConfigRoot` remains the original user profile. Project/root mismatch and changed original user context are rejected before native operations.
- Native mutation, verification, removal and registry inspection select the same explicit root; removal is supplied the recorded actual native registry and TargetContext. Exact existing ownership codecs and native skill transactions are reused.
- The managed artifact layout stays under the selected project, with physical profile canonicalization and no-follow containment reused. User home variables are not replaced and host trust is not granted.
- `CodecGemini` settings.json accepts comments while preserving the existing AST and exact entry receipts. Duplicate keys, malformed input and trailing commas remain errors. Other strict JSON codecs stay strict.
- Independently inspected hujson's parser representation: a final child Value.AfterExtra is cleared for a closing delimiter without a trailing comma and remains present when a trailing comma exists; the new sentinel check therefore does distinguish this format boundary while retaining comments.
- Remaining direct parseDocument calls in transition*.go are guarded closed OpenCode dialect transitions. They do not admit CodecGemini, so no unrelated transition broadening is needed.

## Final review checklist

Review the final scoped policy/catalog and readiness delta, run the full Gemini and nativeconfig packages independently on the frozen tree, and verify user behavior plus scoped isolation/disabled/foreign-edit/collision/alias/attestation boundaries. A cohesive composed source/project lifecycle follows integration; adapter fixture proof must not be labeled native Gemini process certification.

## Final frozen checkpoint verification

Reviewed the exact final tree read-only, including the real core merge, Gemini catalog qualification and project policy, all moved composed contracts in the external providers test package, and the final `document.go` / `gemini_document.go` last-member deletion correction.

- The catalog qualifies only Gemini project scope through its declared native-config lifecycle. It does not select a test constructor or alter the user lifecycle traits.
- Project filesystem success consistently remains ActivationPrepared plus VerificationInstalled, without activation attestation. Neither repeated automatic reconciliation, verify-only, a restart, ambient trust variables nor `--activation-complete` can claim native session discovery. The existing ActivationPreflighter rejects the shortcut before mutation and direct adapter reuse invokes the same guard.
- Preflight reads user/project settings through the exact comment-aware native kernel, preserves disabled skills and MCP restrictions, and reports possible `.agents/skills` shadowing. Workspace trust, system policy and MCP initialization remain explicitly unobserved; there is no new trust/settings engine.
- The composed loader/planner/renderer/stager/activator contract renders portable commands as Gemini skills and installs/removes the exact skill/command/MCP objects under the project root. Foreign entries/comments, user profile and project B remain unchanged. Malformed settings, object collisions, writer-lock failure, scope/root mismatch and changed original user context fail closed.
- The final codec fix removes only trailing commas created by deleting a last managed member, moves surviving foreign trivia to the enclosing delimiter, and revalidates the comment-only document. Native-invalid input trailing commas still fail; unrelated strict JSON codecs remain unchanged. The foreign-trivia regression exercises the problematic preceding member directly.
- Architecture was preserved by moving composed journey tests to `providers/project_gemini_*_test.go`, package providers_test; no upward-import suppression was added.

Independent final execution (`-count=1 -p=2 -timeout=2m`): full Gemini **PASS 0.046s**, full nativeconfig **PASS 3.730s**, full domain **PASS 0.034s**, and providers `^TestProjectGemini` **PASS 0.061s**. The authored CI lint evidence records both exact changed-code and full-file size/architecture gates at zero issues. Shared core CI now discovers TestProject contracts in nativeconfig, providers and all client packages on Linux, macOS and Windows.

No confirmed review finding remains open. These are inert fixture/contract checks, not hosted native Gemini product certification.
32 changes: 32 additions & 0 deletions docs/plans/project-install-e2e/gemini-code-review-r2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Gemini project implementation independent review R2

Reviewer: sources_lead, 2026-10-23. Reviewed exact frozen commit `65b8f17a951e80f06f9ed9c2677dd16a3ccd3d0a` read-only, cumulatively against the reviewed project core. No Gemini worker files were changed.

## Decision

**R2 GO.** No confirmed implementation blocker remains in the Gemini project adapter, bounded settings-policy warnings or precise native-config comment parser. This qualifies the implemented file and lifecycle contracts; native Gemini session discovery, workspace trust, system policy and MCP initialization remain explicitly unobserved. Combined source/project CLI qualification follows integration.

## Independent review findings

- Project selection consistently uses the explicit TargetContext root for planning, registry inspection, native object preparation, activation, verification and removal. Original detected user configuration remains separate. Changed user authority, user registry substitution and managed-root escape fail closed through existing contextual physical-path checks.
- The domain catalog exposes the project native-config component lane without altering user lifecycle traits. The production loader/planner/command renderer/stager/activator composition is exercised by external provider tests; no test-only adapter composition is required.
- Project file success is consistently `ActivationPrepared` and `VerificationInstalled` with `ActivationAttested=false`. Repeated automatic reconciliation and verify-only do not promote readiness. The shared ActivationPreflighter runs before generic activation attestation, and direct adapter reuse also rejects that shortcut before mutation. An ambient trust flag is not accepted as discovery evidence.
- Preserved user/workspace restrictions and a same-name `.agents/skills` alias generate bounded warnings. These checks do not write trust or policy and do not claim to reconstruct Gemini's complete settings engine. System policy and MCP initialization remain explicitly unobserved.
- Native entry receipts and exact skill ownership remain the mutation authority. Project A add/repeat/verify/remove preserves user configuration, project B, foreign skills, foreign MCP entries, settings and comments. Foreign same-name collisions, malformed settings and writer-lock failure leave native state unchanged; removal is repeatable and exact.
- CodecGemini accepts the pinned native format's comments without admitting duplicate keys or input trailing commas. The deletion correction removes only renderer-created trailing commas and preserves surviving foreign trivia. Strict JSON codecs retain their prior parser. Existing OpenCode-only transitions are unaffected.
- Reviewed pinned v0.65.0 release evidence, configuration/help boundaries and the documented original user-root handling. The implementation makes no live-session, model, authentication or native trust claim from these contract tests.

## Independent execution

Executed against the exact clean frozen tree with `-count=1 -p=2`:

| Scope | Result |
| --- | --- |
| Full clients/gemini package | PASS, 0.028s |
| Full adapters/nativeconfig package | PASS, 3.570s |
| Full domain package | PASS, 0.023s |
| Providers `^TestProjectGemini` composition contracts | PASS, 0.072s |

The composed tests cover rendered command skills, MCP and skills, prepared status, attestation rejection, original user context, other-project isolation, restrictions/alias preservation, exact removal, malformed input, collision and rollback. No package payload, model request or MCP server was executed. The hosted native runtime guard remains unchanged.

No review correction was requested in this rotation.
88 changes: 88 additions & 0 deletions docs/plans/project-install-e2e/gemini-implementation-evidence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Gemini project component implementation evidence

Date: 2026-10-23. Implemented frozen code: `65b8f17a`. The selected lane installs
native project skills and MCP configuration; it does not invent a project
extension registry. Independent implementation [R1](gemini-code-review-r1.md)
and [R2](gemini-code-review-r2.md) both grant GO for the bounded file and
lifecycle contracts.

## Pre-code official artifact and help research

Official [Gemini CLI v0.65.0 release bundle](https://github.com/google-gemini/gemini-cli/releases/download/v0.65.0/gemini-cli-bundle.zip):
21,215,960 bytes; SHA256
`bb5e7e879608bd9b3fe261930d3886fa56aacbf471da1655f2978eb35b705a73`.
The artifact checksum was verified before implementation. Actual read-only
version, skills help and MCP help probes ran with no network, no user mounts
and fresh isolated home/project directories. The version reports `0.65.0`;
skills help exposes list, enable, disable, install and uninstall; MCP help
exposes add, remove, list, enable and disable. These observations establish the
pinned help/schema research boundary, not project session discovery.

Primary documentation:
[configuration](https://geminicli.com/docs/reference/configuration/),
[skills](https://geminicli.com/docs/cli/skills/), and
[trusted folders](https://geminicli.com/docs/cli/trusted-folders/).

Read-only inspection of the exact released JavaScript bundle establishes:

- `chunk-AZOL6UFL.js`: project settings are `.gemini/settings.json`; trust gates
workspace merging between user and system settings (`mergeSettings`, around
line16338). The pinned schema defaults folder trust to true, resolving stale
text in the separate trusted-folders page.
- The same chunk defines `mcpServers` named-entry shallow merge around
line12455; `mcp.allowed`/`mcp.excluded` around line13987; skills enabled and
union-merged disabled names around line14692; admin MCP/skills enabled fields
around lines15098/15148. Admin sections use replace merging.
- Native settings parse JSON after stripping comments. Comments are accepted;
input trailing commas remain invalid.
- `chunk-DPTJ5QZL.js`: original user configuration and trust storage stay under
native user authority. Workspace `.agents/skills` is a higher-priority alias
at the workspace tier; neither HOME nor GEMINI_CLI_HOME is rebound to the
project by this implementation.

Offsets identify this immutable bundle and are not claims about future native
versions. No package payload, MCP server or model request was executed during
these probes.

## Implemented contract and limits

Planning, inspection, activation, verification and removal use the actual
selected project `.gemini` root while retaining detected user ConfigRoot.
Managed artifacts remain separately under project `.uap`. Exact MCP receipts,
skill directory ownership, rollback and no-follow/canonical path checks are
reused. Comment-aware Gemini writes preserve foreign entries/trivia; duplicate
keys and trailing commas remain invalid, and other strict JSON codecs retain
their previous parser.

Every configuration-only project success is `ActivationPrepared` plus
`VerificationInstalled`, with no activation attestation. Repeat automatic
reconciliation and read-only verification do not claim native discovery. The
existing preflight port rejects `--activation-complete` before the generic
shortcut, including direct adapter reuse. An ambient trust bypass flag is not
discovery evidence. Trust and policy files are never changed.

Warnings inspect configured user/workspace restrictions and potential
same-name `.agents/skills` alias paths. They do not recreate Gemini's full
settings engine. Session discovery, workspace trust, system policy and MCP
initialization remain explicitly unobserved. The existing user-scope lifecycle
stays unchanged.

## Verification

Production loader, planner, portable command renderer, stager and activator
contracts deliver ordinary skills, command skills and MCP entries into project
A; original user and project B byte/mode inventories remain unchanged. Tests
cover repeated activation/verification, exact repeatable remove, preserved
restrictions/alias, malformed settings, foreign same-name collision, and an MCP
writer failure after skill installation with complete skill rollback.

Author's exact Go1.26.10 checks: composed project contracts PASS0.063s;
native codec project contracts PASS0.008s; full Gemini/nativeconfig/domain
PASS0.028s/3.790s/0.040s. Exact golangci-lint2.13.2 changed-code and whole-file
size/complexity/architecture gates both report zero issues. Both independent
reviewers separately ran the frozen packages and composed tests successfully.

These are inert transport-independent file/composition contracts. Real Gemini
project skills/MCP listing from A plus a fresh session, and the cohesive
source/project CLI scenario, remain separate hosted qualification/integration
gates. The existing hosted-only native runtime guard remains unchanged.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (
)

type document struct {
ast hujson.Value
root *hujson.Object
jsonc bool
ast hujson.Value
root *hujson.Object
jsonc bool
commentsOnly bool
}

func parseDocument(body []byte, jsonc bool) (*document, error) {
Expand All @@ -35,7 +36,9 @@ func parseDocument(body []byte, jsonc bool) (*document, error) {
return &document{ast: ast, root: root, jsonc: jsonc}, nil
}

func newDocument(jsonc bool) (*document, error) { return parseDocument([]byte("{}\n"), jsonc) }
func newDocument(jsonc bool, codec Codec) (*document, error) {
return parseCodecDocument([]byte("{}\n"), jsonc, codec)
}

func rejectDuplicateKeys(value *hujson.Value, path string) error {
switch node := value.Value.(type) {
Expand Down Expand Up @@ -146,11 +149,20 @@ func removeEntry(obj *hujson.Object, name string) bool {
}

func (doc *document) render() ([]byte, error) {
if doc.commentsOnly {
geminiRemoveTrailingCommas(&doc.ast)
}
body := doc.ast.Pack()
if !doc.jsonc && !json.Valid(body) {
return nil, fmt.Errorf("rendered native config is not strict JSON")
}
if _, err := parseDocument(body, doc.jsonc); err != nil {
var err error
if doc.commentsOnly {
_, err = parseCodecDocument(body, false, CodecGemini)
} else {
_, err = parseDocument(body, doc.jsonc)
}
if err != nil {
return nil, fmt.Errorf("validate rendered native config: %w", err)
}
return body, nil
Expand Down
Loading
Loading