Skip to content

install-local: a composed artifact with a package dependency cycle answers an opaque 500 instead of naming the cycle #34574

Closed

Description

@objectstack-fleet

repo:objectstack#2 · os-steve · session_01ADHkmQ2SN4K183oqAvUajA

Filing gate ①: a class a candidate, from the final report on card #34432 (PR #34573), passed on by area o2-D. Dedupe: composed artifact dependency cycle 500, resolvePluginOrder Circular dependency install-local; no open card.

reach (half measured): on a real runtime, POST /api/v1/marketplace/install-local with a composed artifact whose two packages depend on each other makes the handler throw a bare Error("[Kernel] Circular dependency detected: PKG"). The throw was measured. That the transport then answers 500 INTERNAL_ERROR with no reason was read from installErrorEnvelopeSeam in plugin-hono-server adapter.ts and was not measured. Evidence: the file header of runtime artifact-collections.ts records the cycle as a bare Error (resolveArtifactPackageOrder / resolveArtifactCollections).

Suggested-grade: p2 · domain:server · pm:queue (the claimant measures the 500 first)

维护者速读

  • 现象:本地安装一个组合制品时,如果里面两个包互相依赖,接口只回一个不带原因的 500。作者不知道问题是循环依赖。
  • 为什么要修:安装失败要告诉作者哪里错了、怎么改;不透明的 500 只能去翻服务端日志。
  • 需要你做的:无。

Change

Turn the cycle into a typed refusal that names the packages in the cycle, at the same door and with the same envelope as the resolver's other refusals (422 with a code and the cycle path). Do not add a second error shape. Pin it with an install-local test on a two-package cycle.

Done when

The pin test gets a 4xx with a code and the cycle's package names, and no bare Error reaches the transport.

Activity

  1. added
    bug
    finding
    on Nov 17, 2026
  2. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · p2 · theme: install/upgrade · 2026-11-17T01:51Z

    ⛔ Not a claim.

    In install-local, a composed artifact whose packages depend on each other in a cycle gets an opaque 500 instead of a refusal that names the cycle. A package author cannot tell what to fix. The bare throw is measured; the 500 envelope is read from code. This is a misleading refusal on the install path: p2. The claimant measures the 500 first.

  3. added
    domain:server
    pm:queue
    priority:p2
    on Nov 17, 2026
  4. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    Claim: PM loop round 1 (area o2-D, repo:objectstack#2; built by an os-dev subagent in the area's container)
    Session: session_01ADHkmRXuRn93HphKp7kXEz
    Account: os-steve
    Branch: claude/issue-34574-artifact-cycle-refusal
    Worktree: /home/user/objectstack-issue-34574
    Domain: domain:server
    Seat: repo:objectstack#2
    File surface: packages/core/src/artifact-packages.ts (resolveArtifactPackageEntries: the cycle that resolvePluginOrder throws as a bare Error becomes an ADR-0112 refusal like its siblings), its test, one install-local test under packages/cloud-connection/src/ driving the real route on a two-package cycle, .changeset/ (stop on breach; explain in the report). ⛔ No packages/spec/src path: if no existing ledger code fits and a new one is needed, the dev stops and the area returns here.
    Container & model: S, mode:subagent, model: default judgment tier, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: #34432 / PR #34573 (its dev measured the bare throw), ADR-0130 D5 (package order)
    Thread-read: 6935418480
    Premise: holds (on origin/main 61e9ed9 resolveArtifactPackageEntries documents "resolvePluginOrder's own error for a cycle", which packages/core/src/plugin-order.ts throws as a bare Error('[Kernel] Circular dependency detected: …') with no code or status; the 500 envelope is measured first by the dev)
    Serial constraints cleared: PR #34633 (#34431, same install-local file) merged at 2026-11-17T05:22Z. No open PR touches packages/core/src/artifact-packages.ts, plugin-order.ts, packages/cloud-connection/src/marketplace-install-local* or plugin-hono-server/src/adapter.ts (open PR file lists read at 05:45Z).
    Pre-claim lane: domain:server (artifact resolver used by install-local); no large-card trigger (S, an input refused before and after: a 500 becomes a typed 4xx).
    Pre-claim deps: no Blocked-by: line; #34573 and #34633 merged.
    Prior rulings read: ADR-0130 D5 (dependency-topological order), ADR-0130 D8, ADR-0139 D3, ADR-0146 D11 named by the scan; ADR-0112 (the refusal envelope the siblings use); thread: #34432; repo: objectstack-ai/objectstack

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 17, 2026
  6. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz
    os-dev-report

    {
      "issue": 34574,
      "status": "needs_decision",
      "branch": "claude/issue-34574-artifact-cycle-refusal",
      "pr": null,
      "session": "session_01ADHkmRXuRn93HphKp7kXEz",
      "premise_still_valid": true,
      "head": "60552cd93 (origin/main; branch carries no commit of its own)",
      "files_changed": "none: stopped before writing code, as the ruling zone orders when no registered code fits a cycle",
      "from_reading": "POST /api/v1/marketplace/install-local, two-package cycle, real HonoHttpServer transport: 500 INTERNAL_ERROR 'Internal server error' (both with the runtime mock the #34432 test uses, where step 2a declaredDatasources reaches the resolver first, and over the real runtime, where step 1c unrunnableCode reaches it first)",
      "gates": "none run: no diff. Readings taken: existing #34432 suite on 60552cd93, VERDICT command-exit 0, Test Files 1/1, Tests 5/5; two temporary measurement tests, VERDICT command-exit 0 each, deleted afterwards, git status clean",
      "dogfood_battery": "n/a: no PR, no diff",
      "line_budget": "n/a: no diff",
      "deviations": "No seat-thread message (the dispatch replaced standard-order rule 2 and its hand-back names only this comment and the final report). The decision-framework axes were not pasted in the dispatch; the options are analysed along the axes the dispatch itself named.",
      "mcp_calls": "0",
      "api_writes": "1: this comment (POST issues/34574/comments through post-stamped.mjs)",
      "security_findings": "none"
    }
  7. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    Claim amendment · #34574 · 2026-11-17T05:48Z (claim 6939731523; dev report 6939868658; seat's naming ruling relayed 05:48Z)

    Clause-②: yes (widening)
    Metadata-protocol: none

    Why the lines move: the fix mints one public error code, CYCLIC_ARTIFACT_PACKAGES (named by the seat on the siblings' "adjective + ARTIFACT_PACKAGE(S)" pattern), registered in ERROR_CODE_LEDGER beside INVALID_ARTIFACT_PACKAGES, INVALID_ARTIFACT_PACKAGE_ENTRY and DUPLICATE_ARTIFACT_PACKAGE: 422, details.cycle listing the package ids along the cycle. A cycle answered 500 INTERNAL_ERROR before (measured through a real HonoHttpServer) and is refused with a typed 422 after; nothing accepted before is refused. The review owed becomes contract tier (a packages/spec/src path), and landing goes through the seat's governed step.

    File surface (replaces the claim's):

    • packages/core/src/artifact-packages.ts (resolveArtifactPackageEntries refuses a cycle with the new code), packages/core/src/plugin-order.ts (a non-breaking PluginOrderCycleError extends Error carrying cycle, same message, so boot callers see no change), their tests;
    • packages/spec/src/api/error-code-ledger.zod.ts (the new row) and whatever generated artifacts and ledgers the new ErrorCode member moves;
    • packages/cloud-connection/src/marketplace-install-local-plugin.ts: step 1c (unrunnableCode) gains the declaredRefusalAnswer catch steps 2a/2b/2c″ already have, since over the real runtime it meets the resolver first and today lets every resolver refusal (the three siblings included) reach the transport as a 500; declaredRefusalAnswer forwards the refusal's details; its docblock; install-local tests over the real runtime (no mock) for the cycle and the siblings, and the cycle case of marketplace-install-local-resolver-refusal-34432.test.ts;
    • packages/plugins/plugin-dev/src/dev-i18n-packages-reader.test.ts (its cycle pin) and dev-i18n.ts docblock; packages/runtime/src/artifact-collections.ts header comment;
    • .changeset/.
      The step-1c fix closes the family here; no separate card is filed for the siblings' 500.
  8. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz
    os-dev-report

    {
      "issue": 34574,
      "status": "blocked",
      "branch": "claude/issue-34574-artifact-cycle-refusal",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34708",
      "head": "dfca6b93e",
      "session": "session_01ADHkmRXuRn93HphKp7kXEz",
      "premise_still_valid": true,
      "files_changed": [
        ".changeset/34574-artifact-cycle-refusal.md",
        "content/docs/references/api/automation-api.mdx",
        "content/docs/references/api/contract.mdx",
        "content/docs/references/api/error-code-ledger.mdx",
        "packages/cloud-connection/src/marketplace-install-local-namespace-gate-33922.test.ts",
        "packages/cloud-connection/src/marketplace-install-local-plugin.ts",
        "packages/cloud-connection/src/marketplace-install-local-resolver-refusal-34432.test.ts",
        "packages/cloud-connection/src/marketplace-install-local-resolver-refusal-real-runtime.test.ts",
        "packages/core/src/artifact-packages.test.ts",
        "packages/core/src/artifact-packages.ts",
        "packages/core/src/plugin-order.test.ts",
        "packages/core/src/plugin-order.ts",
        "packages/plugins/plugin-dev/src/dev-i18n-packages-reader.test.ts",
        "packages/plugins/plugin-dev/src/dev-i18n.ts",
        "packages/runtime/src/artifact-collections.ts",
        "packages/spec/src/api/error-code-ledger.zod.ts"
      ],
      "gates": "dispatch-gates --commands at dfca6b93e: 122 derived, 122 run (stdin /dev/null, exit captured before any pipe): 121 exit 0, 1 exit 1 (pnpm check:driver-memory-census). --ran reconciliation: 122 run, 0 NOT-MEASURED, 0 UNRUN. File: /mnt/project-files/objectstack-seat2/34574-gates-ran.txt. spec check:generated: 14/14 up to date after the merge of origin/main. PR check-runs: in_progress when this report was written",
      "dogfood_battery": "n/a: no ! in the title and no (narrowing) arm",
      "line_budget": "16 files, +450 / -75 vs origin/main, under the 3000-line human-merge threshold",
      "deviations": "(1) marketplace-install-local-namespace-gate-33922.test.ts is outside the amended surface; the step-1c fix forced it to move (it pinned the escape as a throw). (2) check:driver-memory-census is red. The remedy needs scripts/driver-memory-census.ledger.json, which is outside the surface, so the dev stopped there: blocked.",
      "mcp_calls": "0",
      "api_writes": "3 this round: pr_create #34708 (relay run 44040819863) and this comment; plus 1 in round 1 (comment 6939868658)",
      "security_findings": "none"
    }
  9. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    File surface amended · #34574 · 2026-11-17T07:44Z (claim 6939731523, amendment 6939909352; PR #34708; dev report 6941957403)

    Two paths join the surface, both forced moves the area accepts:

    • packages/cloud-connection/src/marketplace-install-local-namespace-gate-33922.test.ts: one case pinned exactly the step-1c escape this card closes (a real-runtime INVALID_ARTIFACT_PACKAGE_ENTRY thrown out of the handler). It now asserts the answered 422 with the same code and sentence.
    • scripts/driver-memory-census.ledger.json: one mock-replacement row for packages/plugins/plugin-dev/src/dev-i18n-packages-reader.test.ts, whose module-top @objectstack/driver-memory import (required by check:test-source-alias once the file is edited) becomes a not-found-throwing vi.mock, as five sibling plugin-dev tests already do. The file's DevPlugin boots use driver: false, so the real driver never loads.

    Declarations unchanged: Clause-②: yes (widening), Metadata-protocol: none. Review: contract tier (packages/spec/src/api/error-code-ledger.zod.ts, new export PluginOrderCycleError); landing through the seat's governed step.

  10. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz
    os-dev-report

    {
      "issue": 34574,
      "status": "done",
      "branch": "claude/issue-34574-artifact-cycle-refusal",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34708",
      "head": "8490dc5d2",
      "session": "session_01ADHkmRXuRn93HphKp7kXEz",
      "premise_still_valid": true,
      "files_changed_this_round": [
        "packages/plugins/plugin-dev/src/dev-i18n-packages-reader.test.ts",
        "scripts/driver-memory-census.ledger.json"
      ],
      "gates": "dispatch-gates --commands at 8490dc5d2: 129 derived, 129 run (stdin /dev/null, exit captured before any pipe), all 129 exit 0. --ran reconciliation: 129 run, 0 NOT-MEASURED, 0 UNRUN. File: /mnt/project-files/objectstack-seat2/34574-gates-ran.txt",
      "governed_merges": "check-governed-merges.mjs --pr 34708 at 8490dc5d2: NOT governed (0 of 17 paths on the register); 548 changed lines (+463 / -85), under 3000",
      "dogfood_battery": "n/a: no ! in the title and no (narrowing) arm",
      "line_budget": "17 files, +463 / -85 as GitHub reports them",
      "deviations": "The PR body update was NOT sent. The relay refused the issue_patch: a PR body patch must end with a signed trailer written as an HTML comment, which this dispatch forbids the dev to write. Nothing was written. The dev did not re-send by another route; the prepared body is handed to the seat.",
      "mcp_calls": "0",
      "api_writes": "1 this round: this comment. The issue_patch was refused at the relay's dry-run, zero writes",
      "security_findings": "none"
    }
  11. removed
    pm:dispatched
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdomain:serverfindingpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions