Skip to content

fix(javascript): preserve workflow evidence subjects - #9483

Closed
ShuaixinHuang wants to merge 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/javascript-workflow-subject
Closed

ShuaixinHuang wants to merge 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/javascript-workflow-subject

Conversation

@ShuaixinHuang

Copy link
Copy Markdown
Contributor

Fixes #9480.

Summary

Preserve the verified application Evidence subject when creating derived Evidence for trace_application_feature and trace_javascript_semantics. This prevents valid artifact identity from being replaced with a null subject and a misleading unavailable-identity limitation.

Validation

  • npm run test:focused -- src/application/javascript/JavaScriptEvidenceInputs.test.ts
  • git diff --check

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T18:57:21.480414Z da344a1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches two JavaScript trace workflows.

The shared subject conversion must preserve architecture and satisfy the repository’s ownership rule before merging.

Findings

  1. P2 Traces lose known architecture ▶
Fix with agent prompt
### Issue 1
src/application/javascript/JavaScriptApplicationWorkflowService.ts:135-141
Both trace services rebuild the source subject independently and omit `architecture`. `ManagedApplicationGraphService` preserves that field for PE subjects, and feature traces accept those managed graphs. This conversion then turns the known architecture into `null`, even though it is part of `evidenceSubjectIdentity`.

Move the conversion to one shared owner and preserve every subject identity field. The repeated conversion also violates the repository directive to “Normalize once at the owning boundary”; that requirement must be satisfied before merging. Add a test with a non-null architecture, since the updated directory fixtures do not catch this loss.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR passes the source application subject into Evidence created by both trace workflows.

  • Application feature and semantic traces keep their source artifact identity.

Reviews (2) · Last reviewed commit: "fix(javascript): preserve workflow evide..." · Reviewed by Greptile

Comment on lines +135 to +141
source.evidence.subject === null
? undefined
: {
path: source.evidence.subject.local_path,
sha256: source.evidence.subject.digest.sha256,
format: source.evidence.subject.format,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Traces lose known architecture

Both trace services rebuild the source subject independently and omit architecture. ManagedApplicationGraphService preserves that field for PE subjects, and feature traces accept those managed graphs. This conversion then turns the known architecture into null, even though it is part of evidenceSubjectIdentity.

Move the conversion to one shared owner and preserve every subject identity field. The repeated conversion also violates the repository directive to “Normalize once at the owning boundary”; that requirement must be satisfied before merging. Add a test with a non-null architecture, since the updated directory fixtures do not catch this loss.

Context Used: AGENTS.md (source)

Knowledge Base Used: JavaScript and desktop reconstruction

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/application/javascript/JavaScriptApplicationWorkflowService.ts
Line: 135-141

Comment:
**Traces lose known architecture**

Both trace services rebuild the source subject independently and omit `architecture`. `ManagedApplicationGraphService` preserves that field for PE subjects, and feature traces accept those managed graphs. This conversion then turns the known architecture into `null`, even though it is part of `evidenceSubjectIdentity`.

Move the conversion to one shared owner and preserve every subject identity field. The repeated conversion also violates the repository directive to “Normalize once at the owning boundary”; that requirement must be satisfied before merging. Add a test with a non-null architecture, since the updated directory fixtures do not catch this loss.

**Context Used:** AGENTS.md ([source](https://github.com/morluto/rea/blob/main/AGENTS.md))

**Knowledge Base Used:** [JavaScript and desktop reconstruction](https://app.greptile.com/-/switch-tenant?tenant=pre&next=%2Fcustom-context%2Fknowledge-base%2Fmorluto%2Frea%2F-%2Fdocs%2Fjavascript-and-desktop-reconstruction.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da344a10af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +138 to +140
path: source.evidence.subject.local_path,
sha256: source.evidence.subject.digest.sha256,
format: source.evidence.subject.format,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve the source architecture in feature-trace subjects

When trace_application_feature receives a project_managed_application_graph source, its PE subject can contain a known architecture that ManagedApplicationGraphService.ts deliberately preserves. This new projection drops that field, and createEvidence substitutes architecture: null. Architecture participates in evidenceSubjectIdentity and the artifact manifest produced by createEvidenceBundle, so exporting the trace alongside its retained source now produces two distinct artifact declarations for the same PE digest instead of preserving the source identity. Carry the architecture through the subject conversion and cover an architecture-bearing managed graph in the regression test.

AGENTS.md reference: AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

@morluto

morluto commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Thank you for identifying the missing trace Evidence subject. We have incorporated the fix into #9492 with attribution, together with the related feature-view integrity and full subject metadata handling, so I am closing this PR as superseded. We appreciate the report and the contribution.

@morluto morluto closed this Nov 8, 2026
@morluto morluto added area: build Build, CI, packaging, and publishing bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] trace_application_feature and trace_javascript_semantics discard verified Evidence.subject

2 participants