334 Commits

Author SHA1 Message Date
pnoker 769d1cb977 style: apply repository-wide formatting
- expand single-line Javadocs to multi-line blocks, rewrap Markdown prose, and reflow POM, YAML, and TypeScript formatting
- formatting only: no Java code lines changed, no build-file semantics changed
- verified: backend compile and check_documentation.py pass, pnpm check and pnpm lint:check pass, and the dc3 YAML files parse
2026-08-25 13:35:00 +08:00
pnoker 1fa2d6f0cf docs(comments): fill the real comment gaps across the repository
A comment-health audit driven by an AST scanner (regex scanners kept
false-positiving on annotation-separated javadoc; the AST pass with
constructor and @Override-implementation exemptions is what produced a
trustworthy worklist) ended with a much smaller true gap than the raw
numbers suggested: class-level javadoc is already at 100% repository-wide.

What actually gets filled here:

- AnalyticsModel: all 30 nested records of the S19 analytics facet get
  maintainer-voice javadoc (the @Schema descriptions serve the API side;
  these serve code readers).
- The whole entity/ext family (29 files, 47 nested classes): every
  Content/Ui/Validation/Security/AppliesTo/Template/Dedup/... schema
  class states what it actually holds — read from the fields, not
  templated.
- Adapter families: the @Bean methods of all six MQ adapters, all four
  TSDB adapters and the three DB dialect adapters get one-line
  maintainer docs (what binds to what, what is overridable).
- Nested support types across data/agentic/constant/public/facade:
  NotifyBindKey, CacheTuning, Credential, dashboard VOs' Item/BucketVO,
  ExpireListener (plus its null-doc placeholder javadoc replaced with a
  real contract), agentic chat/stream VOs' choice/delta/usage shapes,
  tool-context records, RequestHeader envelopes, FleetSummary,
  visualization Type/Scale codes.
- PointValueSampleConverter's boundary methods now state the port-side
  contract (quality default injection point, batch order preservation).

Comment drift fixed: the class javadoc of the can/mqtt/opc-da driver
skeletons claimed "see TODO markers in method bodies" — those markers
do not exist; the claims are corrected to plain work-in-progress notes.
The genuine TODOs (zigbee API verification, lwm2m lookup, ethernet-ip
CIP framing, CAN JNI) stay: they mark real unimplemented behavior.

Vendored-code boundary: the opc-da module carries a ported
org.openscada library (46 files, package org.openscada.*). Its trivial
accessors stay bare on purpose — filler comments on get/set pairs are
exactly the kind of noise this pass exists to remove — but the
non-obvious JIStruct wire-decoder methods (getStruct/fromStruct
FILETIME + three DO wrappers) now document the COM bridge shape.

Gates: full-repo compile green; data/model/constant/agentic/public
test suites green.
2026-08-24 21:23:39 +08:00
pnoker edadfa0a06 feat(tsdb): rewire the data center onto the tsdb port and retire the repository module
Phase 1b of docs/design/tsdb-abstraction.md: every point-value read and
write now flows through the dc3-tsdb port, and dc3-common-repository is
deleted outright (no compat aliases).

Write path — new PointValueIngestService orchestration in dc3-common-data:
the stale-owner lease guard leaves the history INSERT's cross-schema join
and resolves the active owner per distinct device through the existing
DeviceFacade.getActiveOwner chain; a caffeine-backed ingest idempotency
window (dc3.data.ingest.*, marked only after both writes commit) absorbs
MQ redeliveries now that the message_id unique index is retired; the
batch lands via TsdbStore.append (natural series+time upsert, INGEST_ORDER
kept for the fenced dc3_point_latest upsert).

Read path — history via last(), page() resolves name/enable filters to
series keys through relational metadata (tenant-wide when unrestricted,
cursor offset emulation capped at 10k) with count() for totals; the alarm
window backend becomes TsdbWindowDataSource over aggregate()/history().

Dashboards — all nine data-side hypertable statements move to the S13
analytics facet (count/bucketedCount/countByDimension/latencyHistogram/
lastSeenPerSeries) plus the dc3_point_latest projection for latestStream;
the manager topology statement crosses into the data center via a new
ListSeriesVolumes RPC backed by the new S13-5 seriesCounts primitive (a
point shared by several devices needs per-series counts, which
single-dimension grouping cannot reconstruct); both cross-schema joins
are gone.

Port/adapter — seriesCounts added with a TCK case (23 total); series
filters compile to row-value IN lists chunked at 500 pairs; bootstrap
adds the quality column idempotently and retires uk_point_value_event so
existing deployments converge on the new upsert; the adapter binds the
application-provided tsdbDataSource bean (the history dynamic-datasource
entry) instead of the routing primary.

Timestamps — BO<->Instant conversion is pinned to
TimeConstant.DEFAULT_ZONEID (the platform canonical zone the latest
projection type handler already writes with); the design note's "lock
UTC" is amended accordingly, together with the lease-guard and S13-5
deviations recorded in §6.2.

Seed/deploy — 05-iot-dc3-history.sql gains the quality column and swaps
the unique index; compose carries DC3_TSDB_TYPE; make deploy publishes
dc3-tsdb.

Also fixed along the way: root pom never managed dc3-mq-core (latent,
masked by full-reactor builds); PointValueMapper ran unrouted on the
master datasource (now @DS("history")); latestStream name enrichment
looked up a Long-keyed map with String keys.

Gates: tsdb TCK 23/23, dc3-common-data 262/262, e2e 26/26 including the
unmodified PostgresHypertableIT; full reactor green except dc3-mq-tck's
kafka/pulsar container-startup flake, reproduced identically twice and
unrelated to this change.
2026-08-20 21:58:01 +08:00
pnoker b61d6350a3 docs(repository): align documentation with executable sources 2026-08-19 00:06:08 +08:00
pnoker 956de3dd38 feat(driver)!: enforce lease-fenced durable telemetry
Use PostgreSQL leases and fencing for distributed ownership, require a durable SQLite outbox before RabbitMQ publication, and make Data Center ingestion transactional and idempotent.

BREAKING CHANGE: drivers require mandatory durable outbox configuration and use lease-aware ownership and telemetry contracts.
2026-08-18 00:50:57 +08:00
hongyuan.zhang 6b37cb5ccd docs(readme): refresh module documentation 2026-08-11 22:58:30 +08:00
pnoker 50c6de9438 docs: rewrap project guides and README files
Prose rewrapping and table reflow from a project-wide markdown pass;
no content changes. Also reverts two formatter mistakes: restores
MD5(password) in dc3-web/AGENTS.md and drops spurious spaces after
CJK punctuation in README.zh.md / README.ja.md.

Covers root guides (AGENTS/CONTRIBUTING/SECURITY/README.*), module
READMEs across dc3-api/center/common/driver/e2e/gateway, the nginx
guide, dc3/doc/{README,TITLE}.md, and dc3-web docs.
2026-08-09 18:44:55 +08:00
Henry Zhang 98d8eb80b1 refactor(api): type OAuth grant_type as proto enum (#198)
grant_type in GrpcMcpIntrospectDTO was a free-form string. Introduce
GrpcOAuthGrantType (GRPC_OAUTH_GRANT_TYPE_UNSPECIFIED / AUTHORIZATION_CODE
/ CLIENT_CREDENTIALS / REFRESH_TOKEN). Enum names are upper-case (Java
enum constants must be); the boundary converts to/from the lowercase
OAuth spec form (authorization_code) via toUpperCase / toLowerCase.
BO, DB and OAuth form parameter stay lowercase string.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 19:03:50 +08:00
Henry Zhang 3f78487357 refactor(api): type MCP audit status as proto enum (#197)
audit status in GrpcMcpAuditCommand was a free-form string. Introduce
GrpcMcpAuditStatus (MCP_AUDIT_STATUS_UNSPECIFIED / SUCCESS / DENIED /
POLICY_DENIED / ERROR / UNKNOWN) — names match McpAuditStatusEnum values.
Server maps proto->DTO via name(); facade maps BO string->proto via
toGrpcAuditStatus. BO and DB stay string.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 18:21:20 +08:00
Henry Zhang 4a69185d97 refactor(api): type MCP principal_type as proto enum (#196)
principal_type was a free-form string in GrpcMcpIntrospectDTO and
GrpcMcpAuditCommand. Introduce GrpcMcpPrincipalType
(MCP_PRINCIPAL_TYPE_UNSPECIFIED / USER / SERVICE_ACCOUNT / SYSTEM) —
names match PrincipalTypeEnum values, so the mapping is a direct
valueOf / name(). Server + facade convert at the proto boundary; BO,
gateway and HTTP header layer stay string.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 18:00:45 +08:00
Henry Zhang 3a03962600 refactor(api): type MCP risk_level as proto enum (#195)
risk_level was a free-form string across GrpcMcpToolMetadataDTO,
GrpcMcpToolResolveDTO, GrpcMcpToolAuthorizeDTO and GrpcMcpAuditCommand.
Introduce GrpcMcpRiskLevel (MCP_RISK_LEVEL_UNSPECIFIED / LOW / MEDIUM /
HIGH) — names match McpRiskLevelEnum values, so the mapping is a direct
valueOf / name(). Server + facade convert at the proto boundary; the BO
and DB layer stay string.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 17:24:18 +08:00
Henry Zhang 7c643a8e80 fix(api): dc3-api contract overhaul (auth JWT, history, presence, decision enum) (#193)
* fix(api): correct inverted enable_flag comment and document time unit

- tenant.proto enable_flag comment said "1 enabled, 0 disabled" but the
  actual EnableFlagEnum is ENABLE=0, DISABLE=1 — callers reading the
  comment would invert the flag. Correct it.
- base.proto create_time/operate_time are epoch milliseconds
  (LocalDateTimeUtil/Instant.toEpochMilli); document the unit so callers
  don't guess seconds vs millis.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(api): carry timestamp in point-value history; explicit bool presence

#5 Point-value history: the whole chain (proto -> gRPC server ->
PointValueService -> repository -> facades -> controller -> agentic tool)
returned List<String> and dropped create_time even though the DB row
already carried it. Switch to PointValueBO / FacadePointValueBO end to
end so callers receive each value with its timestamp.

#6 Field presence: GrpcR.ok and McpIntrospectDTO.active are now optional
bool, so "unset" is distinguishable from false on the wire.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(auth): unify JWT signing key, drop salt/password from token contract

The JWT signing key was per-principal — securityKey + ":" + salt, where
salt was the credential salt also carried through the gateway and the
token RPC. That makes the JWT key weak and widens salt exposure to every
gateway hop. Sign with the single configured securityKey (HS256) instead
and remove salt from the JWT path entirely:

- KeyUtil.generateToken/parserToken drop the salt parameter; the HMAC
  key is now just securityKey (must be >= 32 bytes for HS256).
- TokenService.generateToken/checkValid drop the salt parameter.
- token.proto GrpcLoginQuery drops salt and password — CheckValid only
  ever needed tenant, name and token.
- gateway FilterService, TokenGrpcFacade, TokenController adapted; the
  request header no longer feeds salt into validation.

The login-handshake salt (POST /token/salt, used to salt the password
client-side before verifyPassword) is unchanged — only the JWT signing
salt is removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(api): type MCP authorize decision as proto enum

The authorize-tool-call decision was a free-form string, so callers
could only compare it against literals with no compile-time check.
Introduce GrpcMcpDecision (MCP_DECISION_UNSPECIFIED / AUTHORIZED /
CONFIRM_REQUIRED / REJECTED) and type GrpcMcpToolAuthorizeDTO.decision
with it. Enum names match the existing auth-side literals, so the
mapping is a direct valueOf / name().

- McpRuntimeServer builds the enum via toGrpcDecision (unknown -> UNSPECIFIED).
- McpRuntimeGrpcFacade maps enum -> BO string via name().
- gateway unchanged: it receives the BO (string decision) through the facade.

The other string MCP fields (risk_level, status, grant_type,
principal_type) stay strings for now — their value sets are wider and
partly lowercase (OAuth grant_type), so they are a follow-up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(facade): align TokenLocalFacade with 3-arg checkValid (CI compile fix)

TokenLocalFacade (local impl) was missed when TokenFacade.checkValid
dropped salt; CI compiles facade-local-auth independently and caught
it. Align it + its test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 16:36:35 +08:00
pnoker 992026a264 docs: update documentation, architecture diagrams and superpowers analysis
- Update VuePress theme components for architecture diagrams (AuthFlow,
  CommandPlane, DataPlane, FourLayers, Layered, Topology, DiagramFrame)
- Refresh English and Chinese documentation across ai, architecture,
  automation, community, development, drivers, frontend, foundations,
  guide, introduction, operation, and quickstart sections
- Update 5 SVG architecture diagrams (en, zh, ja, vi, panorama)
- Update superpowers analysis reports, plans, and design specs
- Fix Markdown quoting in README.ja.md
2026-07-09 12:55:12 +08:00
pnoker 77a20466bc refactor(api): reorganize proto files from center to common package
- Move proto files from api/center/ to api/common/ for auth, data, manager modules
- Update java_package and java_outer_classname in moved proto files
- Add GrpcDriverQuery message to shared query.proto in dc3-common-api
- Move GrpcDriverQuery proto from common.driver to common package
- Update Java imports referencing relocated proto messages
- Remove redundant pom.xml metadata (developers, licenses, scm, version)
  from api submodules — inherited from parent

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-09 12:43:48 +08:00
pnoker 0d8390db51 fix(tenant): bind tenant context on gRPC server paths
D-1's fail-closed TenantLineHandler rejects unscoped queries, but gRPC
server threads bypass BaseController.async so no tenant was ever bound —
every query against a tenant-scoped table silently failed.

- proto: add tenant_id to manager/driver single & batch query messages
- facade: drop single-param abstract + default matchesTenant filter,
  promote the tenantId-bearing overload (all callers already pass it)
- GrpcFacade/LocalFacade: carry tenant into request / onto ThreadLocal
- 9 manager+driver servers (27 RPCs): setTenantId + finally clear
- data servers: setTenantId on tenant-bearing RPCs; runIgnore for
  getByRecordId (record_id globally unique, no tenant in payload)
- TokenServer.checkValid: runIgnore (dc3_tenant_membership, pre-login)
- driver clients (Device/Driver/Point): set tenant on getById queries
- alarm: drop tenant reverse-resolve (D-1 leftover the fail-closed
  interceptor forbids); tenant now required from upstream, else drop
- add TenantLineInterceptorIntegrationTest (H2) covering scoped filter,
  fail-closed, and runIgnore through the real MyBatis-Plus pipeline
2026-07-03 12:40:10 +08:00
pnoker d18bf4d03d style: fix table alignment and whitespace in README files 2026-06-26 13:17:38 +08:00
pnoker abd826bf6e docs(api): correct gRPC RPC names, import paths, and missing services
Align the four api READMEs with the actual protos: Select*->Get*/List*
per the CRUD verb convention, fix api/common->api/center import paths
for auth/data, drop the fabricated manager SelectByServiceName RPC, and
document the previously omitted auth/data/manager services.
2026-06-22 16:49:07 +08:00
pnoker b80909565e refactor(auth): remove legacy scanner-sourced x-dc3-ai path end-to-end 2026-06-19 01:07:13 +08:00
Vickey a94b2464a4 feat(mcp): authorize high-risk tool calls and harden auth lifecycle
Tool authorization (HIGH-risk confirmation):
- add AuthorizeToolCall RPC; the gateway calls it before tool execution
- sign/consume confirmation tickets with idempotency-key dedup
- propagate x-dc3-ai metadata (riskLevel/destructive/openWorld/idempotent) from the scan through the registry to the tool catalog

OAuth hardening:
- rotate refresh tokens and revoke the authorization on replay via previous_refresh_token_hash

Password lifecycle:
- require password change on login when flagged or expired (R20303/R20304)
- expose a public POST /token/change_password endpoint

OpenAPI aggregation:
- switch McpOpenApiAggregator to classpath static snapshots, dropping the runtime fetch and McpAggregatorProperties
2026-06-18 14:08:05 +08:00
pnoker 8ea0c0faf3 refactor(mcp): route runtime calls through facade 2026-06-12 22:38:30 +08:00
pnoker 7dacc47056 docs(auth): document principal and mcp architecture
Update auth, gateway, architecture, quickstart, changelog, and superpowers design documents for the Principal identity model and OAuth-backed MCP server.
2026-06-12 21:20:41 +08:00
pnoker 35dc46e95f feat(auth): introduce principal identity model
Replace legacy user-login and role-user binding runtime with Principal, LocalCredential, TenantMembership, ServiceAccount, and RolePrincipalBind.

Switch gateway/backend identity propagation to X-Auth-Principal and align agentic/controller security context types with PrincipalHeader.
2026-06-12 21:18:54 +08:00
pnoker fe766350b9 fix(auth): enforce cross-service permissions 2026-06-10 20:36:58 +08:00
Vickey b3ee76f893 refactor(data): unify command history status/type/source to enum index
Align CommandHistory/PointCommandHistory with the EventHistory pattern:
DB stores the enum index (SMALLINT via @EnumValue), gRPC carries int32,
JSON keeps enum name. Removes the lone string-code outlier in the schema.

- DO status/type/source: String code -> enum types
- VO type/source: String -> enum (status already enum); JSON stays name
- Builder: drop ofCode @AfterMapping (DO and VO now share enum type)
- RabbitMQ DTOs (CommandCall/PointCommandResult): status/source -> enum
- driver sendResult signatures: String status -> PointCommandStatusEnum
- gRPC command_history.proto status/source: string -> int32; server uses
  getIndex()/ofIndex() to match EventHistoryServer
- tests updated to assert enum values
2026-06-09 18:05:40 +08:00
pnoker 5730f7c137 feat: update pom version 2026-06-06 13:00:39 +08:00
pnoker b5ef7a8501 fix(pom): clean up dependency management and plugin configuration
- Replace obsolete nexus-staging-maven-plugin with central-publishing-
  maven-plugin in dc3-api and dc3-common
- Remove 20 redundant version declarations from dc3-coverage dependencies
- Fix snmp4j version from non-existent 3.8.3 to available 3.7.4
2026-06-06 00:40:18 +08:00
pnoker a7b19611a3 refactor: rename proto RPCs and facade methods to follow conventions
Proto RPC renames:
- command_history.proto: Call→CallCommand, List→ListByPage
- event_history.proto: Report→ReportEvent, List→ListByPage
- point_value.proto: LastValue→GetLastValue, HistoryValue→ListHistoryValues

Facade interface renames:
- StatusHealthFacade: selectDeviceStatusesByIds→listDeviceStatusesByIds,
  selectDeviceStatusesByProfileId→listDeviceStatusesByProfileId,
  selectDriverStatusesByIds→listDriverStatusesByIds

Update all gRPC server implementations, client stubs, and test files.
2026-06-06 00:03:20 +08:00
Vickey 918b3d5e8e feat: update pom version to 2026.5.22 2026-05-26 00:30:11 +08:00
Vickey dedb03fe74 feat: add command/event attribute configuration system
Introduce CommandAttribute/EventAttribute with config variants:
- REST controllers, MyBatis mappers, services, and DAL managers
- gRPC client/server builders and proto message definitions
- DTOs, BOs, DOs, VOs for type-safe data transfer layer

fix: add explicit ::text casts in json_build_object parameters

PostgreSQL cannot infer parameter types inside json_build_object()
calls. Add ::text casts to #{stateExtType} and #{stateDescription}
to resolve "could not determine data type of parameter $10" errors.

refactor: restructure driver gRPC client and metadata layer

- Rename GrpcStubConfig to DriverClientStubConfig with dedicated DTOs
- Extract attribute builders from inline gRPC conversion logic
- Consolidate driver metadata, register service, and command handling
- Update device state heartbeat and command result event handling

docs: add multilingual architecture diagram and sync READMEs

- Translate architecture SVG into zh, ja, vi variants
- Update README architecture image references per language
- Add missing service-level shortcut sections to ja/vi READMEs
2026-05-25 00:00:00 +08:00
pnoker 3b378e854b refactor: align data history models and constants 2026-05-24 01:07:02 +08:00
pnoker 150ba33244 feat: add custom command call API, event report API with RabbitMQ and gRPC
- Add dc3_command_record and dc3_event_record DTOs, DOs, mappers, managers
- Implement CommandRecordService: call flow with validation, RabbitMQ dispatch,
  result/dead receivers, full lifecycle (PENDING→SENT→SUCCESS/FAILED/TIMEOUT/DEAD)
- Implement EventReportService: report flow with validation and persistence
- Add REST controllers: /command_record (call/get/list), /event_report (report/get/list)
- Add RabbitMQ exchanges/queues/bindings for command dispatch, result, dead letter
- Add event exchange for driver→center event reporting
- Add gRPC CommandRecordApi and EventReportApi with proto definitions and servers
- Fix PointCommandValidator parameter type (String→PointExt)
2026-05-23 18:26:28 +08:00
Vickey aa5c4ddf8e feat: add Command and Event model with full CRUD stack and facade layer
Phase 2 — Command & Event 模型定义闭环:
- 5 new enums: CommandTypeFlag, CallTypeFlag, ParamDirectionFlag, EventTypeFlag, EventLevelFlag
- 4 Ext types: CommandExt, CommandParamExt, EventExt, EventParamExt
- 4 entity stacks (DO/BO/VO/Query/Builder): Command, CommandParam, Event, EventParam
- Mapper/XML with device JOIN support, Manager, Service with tenant validation
- 4 REST controllers, 2 gRPC servers, proto definitions (entity, query, page, service)

Phase 3 — Facade + Agentic 工具:
- Facade API: CommandFacade, EventFacade with tenant-scoped defaults
- gRPC Facade: CommandGrpcFacade, EventGrpcFacade with hand-rolled builders
- Local Facade: CommandLocalFacade, EventLocalFacade with MapStruct mappers
- GrpcStubConfig: register CommandApi and EventApi blocking stubs
- Agentic tools: CommandTool and EventTool (5 @Tool methods each)
2026-05-23 18:05:15 +08:00
pnoker 9007cbc22c style: apply consistent code formatting across all modules and docs 2026-05-22 00:24:22 +08:00
pnoker e38c7d432a feat(driver,manager): broadcast driver metadata events and let drivers refresh on demand
Extends the existing point/device metadata refresh flow to drivers:

- MetadataEvent gains an optional targetServices set so manager-side
  publishers can scope a metadata event to specific driver services
  instead of broadcasting to every listener.
- New DRIVER value on MetadataTypeEnum, plus a new GetById RPC on
  driver_driver.proto so drivers can re-fetch their registered metadata
  without going through the full registration handshake again.
- DriverClient.refreshMetadata(driverId) calls the new RPC and reapplies
  the returned device ids and attribute maps via a shared applyMetadata
  helper.
- MetadataReceiver now handles MetadataTypeEnum.DRIVER:
    DELETE  -> clear DriverMetadata, DeviceMetadata, and PointMetadata
              caches and flip status to OFFLINE
    ADD/UPDATE -> driverClient.refreshMetadata(id)
- Manager-side MetadataEventListener forwards events to RabbitMQ keyed by
  the target services in the event, falling back to broadcast when none
  are specified.
- DeviceServiceImpl, DriverAttributeServiceImpl, PointAttributeServiceImpl,
  and PointServiceImpl populate targetServices using the relevant driver
  service names so changes only wake the drivers that own the affected
  entity.
- DriverDriverServer.getById exposes the new RPC; new DriverDriverServerTest
  covers it.
- MetadataReceiverTest gains driverUpdate / driverDelete cases;
  MetadataEventListenerTest covers the per-service routing.
2026-05-21 15:02:09 +08:00
pnoker 5a3ab1440a test: improve backend test coverage governance 2026-05-19 18:19:12 +08:00
Vickey 476799e513 refactor(api): rename gRPC SelectBy* RPCs to GetBy*/ListBy*
Apply the new naming convention to .proto contracts so the verb on
each RPC reflects the cardinality of its result:

  - get*  for single-record returns (RPCs returning a single DTO)
  - list* for multi-record returns (RPCs returning a Page or List DTO)

23 RPCs renamed across 9 .proto files. Returns-single -> Get*:
  user.proto                 SelectById        -> GetById
  user_login.proto           SelectByName      -> GetByName
  tenant.proto               SelectByCode      -> GetByCode
  driver_device.proto        SelectById        -> GetById
  driver_point.proto         SelectById        -> GetById
  manager_point.proto        SelectById        -> GetById
  manager_device.proto       SelectByDeviceId  -> GetByDeviceId
  manager_driver.proto       SelectByDriverId  -> GetByDriverId
  manager_driver.proto       SelectByDeviceId  -> GetByDeviceId
  manager_profile.proto      SelectByProfileId -> GetByProfileId

Returns-multi -> List*:
  driver_device.proto        SelectByPage         -> ListByPage
  driver_point.proto         SelectByPage         -> ListByPage
  manager_device.proto       SelectByPage         -> ListByPage
  manager_device.proto       SelectByDriverId     -> ListByDriverId
  manager_device.proto       SelectByProfileId    -> ListByProfileId
  manager_device.proto       SelectByDeviceIds    -> ListByDeviceIds
  manager_driver.proto       SelectByPage         -> ListByPage
  manager_driver.proto       SelectByDriverIds    -> ListByDriverIds
  manager_point.proto        SelectByPage         -> ListByPage
  manager_point.proto        SelectByIds          -> ListByIds
  manager_profile.proto      SelectByPage         -> ListByPage
  manager_profile.proto      SelectByProfileIds   -> ListByProfileIds
  manager_profile.proto      SelectByDeviceId     -> ListByDeviceId

This is a wire-level breaking change: gRPC clients and servers must
upgrade in lockstep. Server impls, facade clients, and Java callers
are aligned in subsequent commits.
2026-05-18 19:19:40 +08:00
pnoker 7f5da1a0f8 chore: bump version to 2026.5.18 across all modules 2026-05-18 00:24:22 +08:00
pnoker 994ccba991 docs: update READMEs and project documentation
Refresh module READMEs, AGENTS.md, CONTRIBUTING.md, and dc3/doc/
guides to reflect the unified Dockerfile, consolidated compose stacks,
and updated build instructions.
2026-05-17 19:03:21 +08:00
pnoker 996518186a build: bump version to 2026.5.17
Update parent version and dc3.version from 2026.5.5 to 2026.5.17
across all Maven modules.
2026-05-17 19:01:44 +08:00
pnoker 20bb57df17 refactor(agentic): split chat orchestration and structure tool results 2026-05-16 16:23:48 +08:00
pnoker ca0393ae7b feat(agentic): expand platform tool capabilities 2026-05-14 23:45:30 +08:00
pnoker df06264f9c fix(facade,manager): harden grpc calls and add bulk lookups 2026-05-09 18:49:51 +08:00
pnoker 0434d5b033 fix(facade): preserve unset enable flag in grpc queries 2026-05-09 18:49:51 +08:00
pnoker e47299a327 chore: remove format and format-check targets from Makefile 2026-05-07 23:55:32 +08:00
pnoker eefe411bd7 chore(build): upgrade spring-javaformat to 0.0.47 and add Checkstyle integration
- Add maven-checkstyle-plugin with spring-javaformat-checkstyle rules
- Add custom checkstyle.xml excluding overly strict rules for existing codebase
- Exclude third-party driver code (serotonin, openscada, nodave) from checks
- Configure plugins in dc3-common and dc3-api POMs for full module coverage
- Add .springjavaformatconfig placeholder
2026-05-07 16:46:17 +08:00
pnoker 6992c20e5e feat(api): expand point_value.proto with HistoryValue, ReadCommand, and WriteCommand RPCs
Add three new RPC methods to PointValueApi: HistoryValue for querying
historical point values, ReadCommand and WriteCommand for device control.
Define corresponding request/response message types.
2026-05-07 00:09:08 +08:00
pnoker 95c40b2387 chore: bump version to 2026.5.5
Roll every pom, per-module README, Spring banner, and @version /
@since javadoc tag from 2026.4.30 to the new 2026.5.5 release line.
2026-05-05 00:56:09 +08:00
Vickey 706917dd2e feat(auth): add api_group to cluster endpoints by owning controller
Thread a new api_group field end-to-end through the scanner, gRPC/local
facade, proto, auth entity layer, and registry sync service. Populated
from handler.getBeanType().getSimpleName() (e.g. ApiController), this is
the foundation for the forthcoming resource-tree hierarchy grouping
sibling endpoints under their controller.
2026-05-01 17:30:02 +08:00
pnoker ddac60f4f7 refactor(auth): drop tenant from registry resources 2026-05-01 16:33:17 +08:00
Vickey fb9ee53781 feat: auto-register center API endpoints to auth resource tables
Adds a startup-time registrar that scans the local WebFlux handler mappings
of each center service and reconciles the discovered endpoints against
dc3_api and dc3_resource (insert-if-missing, update-if-drifted, soft-delete-
if-orphaned), so the permission model is no longer hand-maintained.

Wiring:
- dc3-common-resource-registrar (new module): scanner, diff runner, Spring
  Boot AutoConfiguration. Activates on ApplicationReadyEvent.
- dc3-common-facade-api: ResourceRegistryFacade + BOs define a transport-
  neutral sync contract.
- dc3-common-facade-local / dc3-common-facade-grpc: two implementations
  selected via dc3.facade.mode. center-auth/single use local; manager/data
  call auth via gRPC.
- dc3-common-auth: biz-side ResourceRegistrySyncService performs the three-
  way diff inside a transaction guarded by pg_advisory_xact_lock(hashtext
  (serviceName)); exposes ResourceRegistryApi gRPC server.
- dc3-api-auth: new resource_registry.proto contract.
- ApiDO/BO/VO/Query gain a serviceName field so each service's endpoints
  can be located with a single indexed lookup.

Deployment-visible changes:
- api_code format is the human-readable serviceName:METHOD:/path
- dc3_resource.resource_code format is api:serviceName:METHOD:/path
  (prefixed namespace reserved for future resource types)
- center-auth application.yml sets dc3.facade.mode=local
- 4 center pom.xml files pull in the registrar (auth also gets facade-local)
2026-04-30 21:40:45 +08:00