Skip to content

docs(primitives): document declared data extraction for remaining kinds - #168

Merged
sourcehawk merged 1 commit into
mainfrom
worktree-docs-declared-data-primitives
Aug 2, 2026
Merged

docs(primitives): document declared data extraction for remaining kinds#168
sourcehawk merged 1 commit into
mainfrom
worktree-docs-declared-data-primitives

Conversation

@sourcehawk

Copy link
Copy Markdown
Owner

Description

The declared data extraction API from #165 (ExtractInto, WithDataGuard, WithOptionalData) is exported by every primitive package, but only 11 of the 22 per-kind pages under docs/primitives/ documented it. Anyone reading the ConfigMap, Deployment or Secret page had no way to learn the feature exists from the docs alone. This fills the remaining 11 pages using the same section shape the pages updated in #165 already use.

Changes

  • Added a Data Extraction section to the configmap, cronjob, daemonset, deployment, hpa, job, pod, pv, replicaset, secret and statefulset pages, each covering the kind-specific ExtractInto signature and the WithDataGuard / WithOptionalData read declarations on the builder.
  • Each example extracts a value that is genuinely interesting for that kind rather than a shared placeholder: the assigned PodIP for Pod, the bound ClaimRef for PersistentVolume, the rollout revision annotation for Deployment, CurrentRevision for StatefulSet, NumberReady for DaemonSet, LastScheduleTime for CronJob, the generated credential for Secret, and so on.
  • Two short cautions where they earn their place: a cell extracted from a Secret holds decoded plaintext for the rest of the reconcile, and a Job's completion should be gated on its Completable status rather than a data cell.
  • Regenerated plugin/skills/using-primitives/references/primitives/ with make sync-plugin.

Section placement follows service.md: after the editor and convenience-method content, before the first status or suspension section.

Challenges

Getting the examples right meant checking every snippet against the real signatures rather than pattern-matching from the pages that already had the section. Each of the 11 snippets was transcribed verbatim into a temporary test in the module and compiled and run against the primitive packages, which caught the cases needing nil handling (CronJob.Status.LastScheduleTime and PersistentVolume.Spec.ClaimRef are pointers) before they reached the docs. The temporary file was removed before committing.

Related

Testing

Documentation only, no source changes. make lint-md is clean and make fmt-md produced no further changes. make docs-build passes in strict mode, which confirms the new ../component.md#declared-data anchors resolve. go test ./... passes. The compile check described above is the main source of confidence in the snippets: every documented ExtractInto call, cell type and WithDataGuard / WithOptionalData chain type-checks against the current packages. make sync-plugin regenerated only the 11 expected reference files, with no unrelated drift.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PhRYyAS9tcQcg6iZXMoVfd

PR #165 added ExtractInto to every primitive package but documented it in
only 11 of the 22 per-kind pages. Add a Data Extraction section to the
remaining kinds, matching the structure used by the pages updated in #165:
the kind-specific ExtractInto signature with a realistic extraction target,
and the WithDataGuard / WithOptionalData read declarations on the builder.

Every snippet was compile checked against the primitive packages.

Regenerated the plugin skill references with make sync-plugin.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PhRYyAS9tcQcg6iZXMoVfd
Copilot AI review requested due to automatic review settings August 2, 2026 18:19
@sourcehawk
sourcehawk merged commit bbd3aba into main Aug 2, 2026
7 checks passed
@sourcehawk
sourcehawk deleted the worktree-docs-declared-data-primitives branch August 2, 2026 18:22

Copilot AI 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.

Pull request overview

This PR expands the primitives documentation to consistently cover the “declared data extraction” API (ExtractInto, WithDataGuard, WithOptionalData) across the remaining per-kind pages, and regenerates the Claude plugin reference copies to match.

Changes:

  • Added a new Data Extraction section to 11 previously-missing primitives pages under docs/primitives/.
  • Included kind-specific ExtractInto examples plus guidance on WithDataGuard / WithOptionalData, with a couple of targeted cautions (Secret plaintext handling; Job completion gating).
  • Regenerated the corresponding plugin reference markdown files under plugin/skills/using-primitives/references/primitives/.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/primitives/configmap.md Adds Data Extraction section and example for ConfigMap.
docs/primitives/cronjob.md Adds Data Extraction section and example for CronJob.
docs/primitives/daemonset.md Adds Data Extraction section and example for DaemonSet.
docs/primitives/deployment.md Adds Data Extraction section and example for Deployment.
docs/primitives/hpa.md Adds Data Extraction section and example for HPA.
docs/primitives/job.md Adds Data Extraction section, example, and completion-gating caution for Job.
docs/primitives/pod.md Adds Data Extraction section and example for Pod.
docs/primitives/pv.md Adds Data Extraction section and example for PersistentVolume.
docs/primitives/replicaset.md Adds Data Extraction section and example for ReplicaSet.
docs/primitives/secret.md Adds Data Extraction section, example, and plaintext caution for Secret.
docs/primitives/statefulset.md Adds Data Extraction section and example for StatefulSet.
plugin/skills/using-primitives/references/primitives/configmap.md Regenerated plugin reference copy reflecting the ConfigMap docs update.
plugin/skills/using-primitives/references/primitives/cronjob.md Regenerated plugin reference copy reflecting the CronJob docs update.
plugin/skills/using-primitives/references/primitives/daemonset.md Regenerated plugin reference copy reflecting the DaemonSet docs update.
plugin/skills/using-primitives/references/primitives/deployment.md Regenerated plugin reference copy reflecting the Deployment docs update.
plugin/skills/using-primitives/references/primitives/hpa.md Regenerated plugin reference copy reflecting the HPA docs update.
plugin/skills/using-primitives/references/primitives/job.md Regenerated plugin reference copy reflecting the Job docs update.
plugin/skills/using-primitives/references/primitives/pod.md Regenerated plugin reference copy reflecting the Pod docs update.
plugin/skills/using-primitives/references/primitives/pv.md Regenerated plugin reference copy reflecting the PV docs update.
plugin/skills/using-primitives/references/primitives/replicaset.md Regenerated plugin reference copy reflecting the ReplicaSet docs update.
plugin/skills/using-primitives/references/primitives/secret.md Regenerated plugin reference copy reflecting the Secret docs update.
plugin/skills/using-primitives/references/primitives/statefulset.md Regenerated plugin reference copy reflecting the StatefulSet docs update.

Comment thread docs/primitives/job.md
Comment on lines +199 to +200
Guard on the Job's `Completable` status when a later resource must wait for the Job to finish. Data cells carry values
between resources; they are not a substitute for the completion condition.
Comment on lines +199 to +200
Guard on the Job's `Completable` status when a later resource must wait for the Job to finish. Data cells carry values
between resources; they are not a substitute for the completion condition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants